[DUG] call a method function from outside object

Guy.Brown at sungard.com Guy.Brown at sungard.com
Mon Jul 11 15:24:31 NZST 2005


Hi Ross.  My Delphi is a bit rusty but I believe it's just:

DLLOpen := Open;

Assuming that DLLOpen is declared as a procedure of object with the
appropriate parameter list.

hth

Guy

-----Original Message-----
From: delphi-bounces at ns3.123.co.nz [mailto:delphi-bounces at ns3.123.co.nz]
On Behalf Of Ross Levis
Sent: Sunday, 3 July 2005 5:48 p.m.
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] call a method function from outside object

In trying to solve this I thought of using method functions inside an
object rather than standard functions, and then assigning the method
pointer to the DLL, but I can't seem to do this either.  eg. In a class
procedure I do this...

  DLLOpen := TMethod(Open).Code;  <<< Invalid typecast

Open is a function defined in the same class DLLOpen is the function
pointer defined in the DLL which I need to assign to the method pointer.

I'm not sure why this doesn't work.  My only other option is to use
global variables!

Regards,
Ross.

----- Original Message -----
From: "Ross Levis" <ross at stationplaylist.com>
To: "NZ Borland Developers Group - Delphi List" <delphi at ns3.123.co.nz>
Sent: Sunday, July 03, 2005 4:56 PM
Subject: [DUG] call a method function from outside object


In a component I'm writing, a DLL needs access to a standard function so
this is declared outside the main object.  Within this function I want
to access variables and methods inside the main object, but I can't find
a way to do it.  Is this possible?

Thanks,
Ross.

_______________________________________________
Delphi mailing list
Delphi at ns3.123.co.nz
http://ns3.123.co.nz/mailman/listinfo/delphi

_______________________________________________
Delphi mailing list
Delphi at ns3.123.co.nz
http://ns3.123.co.nz/mailman/listinfo/delphi



More information about the Delphi mailing list