Can't get this web application to work.

From: L. Healy (L.Healy_at_occpsy.demon.co.uk)
Date: 10/31/03


Date: Fri, 31 Oct 2003 12:24:05 +0000

Hi,

I think this is correct place to post this, I can't find any Delphi
Internet specific groups.

I am toe dipping with Internet programming for the first time, and
working through an example in an old Delphi 3 book I have, which is
generally excellent. I don't think anything I am trying to do with D6 is
obsolete but I am having problems.

I have complied the following Web Server Application as an ISAPI/NSAPI
dll application. I am posting all the code so you can see what I have
done :

===

unit Unit1;

interface

uses
  SysUtils, Classes, HTTPApp;

type
  TCurrentTimeDisp = class(TWebModule)
    procedure CurrentTimeDispDefaultActionAction(Sender: TObject;
      Request: TWebRequest; Response: TWebResponse; var Handled:
Boolean);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  CurrentTimeDisp: TCurrentTimeDisp;

implementation

{$R *.DFM}

procedure TCurrentTimeDisp.CurrentTimeDispDefaultActionAction(
  Sender: TObject; Request: TWebRequest; Response: TWebResponse;
  var Handled: Boolean);
begin
Response.Content := '<H1>Hello</H1> <HR>' +
                    'The Current Time is '+
                    TimeToStr(SysUtils.Time);

end.

===

Now when I post it to the web server I am experimenting with, and type
in the URL ......./xyz.dll

the browser insists on downloading it and asking what I want to with it.
According to the example it should just run within the browser and show
the time.

I have set the permissions properly. But no joy. Does anyone have any
useful observations ? Sorry if this is a stupid question but I have
never tries and web programming before apart from a tiny bit of cgi. I
dont even know if it is a Delphi problem, or a server problem.

Thanks
Liam Healy



Relevant Pages

  • Re: Cant get this web application to work.
    ... > I think this is correct place to post this, I can't find any Delphi ... > Internet specific groups. ... > I have complied the following Web Server Application as an ISAPI/NSAPI ... > the browser insists on downloading it and asking what I want to with it. ...
    (comp.lang.pascal.delphi.misc)
  • Re: Converting Program for Use on the Web?
    ... > I've written a complex function in Delphi 6 for Windows desktop. ... > and be available to multiple web sites. ... it works on *any* Web server running on Windows platform ...
    (comp.lang.pascal.delphi.misc)
  • Re: some interesting perspectives on .NET from the other camp ...
    ... A heavy investment much more easily served by.. ... .NET is great for web development, ... the client and server (not web server) side, ... Want native support in Delphi for AMD64/EM64T? ...
    (borland.public.delphi.non-technical)
  • Architectural Question? - Web Database Dev with Delphi 8 .NET
    ... Can anybody tell me what facilities Delphi 8 .NET have that can enable me to ... develop Internet Enabled Database apps. ... The Client Program ... because they say that if your DLL or EXE crashes the Web Server ...
    (comp.lang.pascal.delphi.misc)
  • Re: Delphi Socket Servers: If you were shown how, would you?
    ... adopt a non-delphi web server technology platform if he/she already ... knew how to build a web server with Delphi... ... Are there any Delphi Developers with web sites based on pure Delphi ... I immediately ported my app over to ...
    (borland.public.delphi.non-technical)