Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Mi Mai 15, 2024 03:02

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 7 Beiträge ] 
Autor Nachricht
 Betreff des Beitrags: delphi 2005 .net question
BeitragVerfasst: Di Nov 23, 2004 15:39 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
I am currently trying to get ihttphandler getting to work within delphi. But all i get is that ihttphandler is not defined. I know it is as it lives inside system.web as i am able to use it from vb.

e.g. in vb i use

imports System.Web

public class MyHttpHandler
implements ihttphandler

Now for delphi 2005 .net i think i have to do something like:

uses System.Web

type
TMyHttpHandler = class(TInterfacedObject, IHttpHandler)

but all i get is that IHttpHandler is not defined. What am i doing wrong?
Or is it the fact that i try to do this from a library? It should be as i also do this with vb.net a ihttphander lives inside an dll file.

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Nov 23, 2004 18:23 
Offline
DGL Member
Benutzeravatar

Registriert: Sa Dez 28, 2002 11:13
Beiträge: 2244
Is system.web.dll in the project references list ?


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Nov 23, 2004 19:27 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
ah, that did the trick. I just feel stupid as i also do a thing like that with vb.net :oops:

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Nov 23, 2004 20:25 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
now on to the next problem, this time i do not even get an compiler error, but an access violation error.....

this is the code
type
tmyhandler = class(TInterfacedObject, IHttpHandler, IRequiresSessionState)
procedure IHttpHandler.ProcessRequest = myProcessRequest;
procedure myProcessRequest(ByVal: System.Web.HttpContext): System.Web.IHttpHandler.ProcessRequest
end;

begin
procedure tcontext.myprocessrequest(ByVal: System.Web.HttpContext): System.Web.IHttpHandler.ProcessRequest
begin
response.write('Hello world!');
end;

Now i must be doing something wrong again....

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Nov 23, 2004 23:52 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
fixed that also:

Code:
  1.  
  2. type
  3.  tmyhandler = class(TInterfacedObject, IHttpHandler, IRequiresSessionState)
  4.    procedure ProcessRequest(context: HttpContext);
  5.    function get_IsReusable: boolean;
  6.    property IsReusable: boolean read get_IsReusable;
  7.   end;
  8.  
  9.   procedure tmyhandler.ProcessRequest(context: HttpContext);
  10.   begin
  11.     //response.write('Hello world!');
  12.   end;
  13.  
  14.   function tmyhandler.get_IsReusable: boolean;
  15.   begin
  16.     result:=false;
  17.   end;
  18.  

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Nov 24, 2004 11:17 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
now it compiles ok, but iis does not find it an valid httphandler class.
tmyhandler cannot be found inside the dhandlertest.dll assembly...
i am starting to dislike delphi2005 for this...
any ideas on what i am doing wrong...

also as a side note the vb version of my httphandler is only 36kb large and this incomplete non working implementation is 99kb large, using classes with it makes it 1mb large....

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Fr Nov 26, 2004 11:24 
Offline
DGL Member
Benutzeravatar

Registriert: Di Jul 01, 2003 18:59
Beiträge: 887
Wohnort: (The Netherlands)
Programmiersprache: fpc/delphi/java/c#
i found out why it does not work. I seems that delphi.net is not cls complaint. Read the folowing thread if you want to know more about it: http://newsgroups.borland.com/cgi-bin/d ... ated+Items

_________________
http://3das.noeska.com - create adventure games without programming


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 7 Beiträge ] 
Foren-Übersicht » English » English Programming Forum


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 3 Gäste


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.032s | 17 Queries | GZIP : On ]