Thread View: borland.public.delphi.activex
2 messages
2 total messages
Started by Kenneth R. Lewis
Fri, 17 Dec 1999 00:00
Calling a procedure/function
Author: Kenneth R. Lewis
Date: Fri, 17 Dec 1999 00:00
Date: Fri, 17 Dec 1999 00:00
45 lines
1701 bytes
1701 bytes
What way can I use to call a procedure/function in a class that is part of
an Active X Library. GetProcAddress doesn't work in a class. What would be
the best way to call a routine in a class. Or am I doing it wrong???
Example
type
TDLLProcedure = procedure; stdcall;
TMyActiveX = class(TAutoObject, IMyInterface)
protected
procedure Call1; stdcall;
procedure Call2; stdcall;
procedure CallProcedure(AProcName: WideString); stdcall;
end;
implementation
TMyActiveX.Call1;
begin
ShowMessage('Call1');
end;
TMyActiveX.Call2;
begin
ShowMessage('Call2');
end;
TMyActiveX.CallProcedure(AProcName: WideString);
var AProc: TDLLProcedure;
begin
@Proc := GetProcAddress(HInstance, AProcName);
if @Proc <> nil then
Proc
else
ShowMessage('I don't think so!');
end;
Thank you
Kenneth Lewis
Travel Technologies Group
Re: Calling a procedure/function
Author: Jernej Kase
Date: Mon, 20 Dec 1999 00:00
Date: Mon, 20 Dec 1999 00:00
59 lines
1843 bytes
1843 bytes
Where is zhe function you'd like to call? If it's in another dll you should
use Loadlibrary first, and then GetProcAdress.
If it's in the same dll you can call it directly...
Regards,
Jernej
Kenneth R. Lewis wrote in message ...
>What way can I use to call a procedure/function in a class that is part of
>an Active X Library. GetProcAddress doesn't work in a class. What would
be
>the best way to call a routine in a class. Or am I doing it wrong???
>
>Example
>
>type
> TDLLProcedure = procedure; stdcall;
>
> TMyActiveX = class(TAutoObject, IMyInterface)
> protected
> procedure Call1; stdcall;
> procedure Call2; stdcall;
> procedure CallProcedure(AProcName: WideString); stdcall;
> end;
>
>implementation
>
>TMyActiveX.Call1;
>begin
> ShowMessage('Call1');
>end;
>
>TMyActiveX.Call2;
>begin
> ShowMessage('Call2');
>end;
>
>TMyActiveX.CallProcedure(AProcName: WideString);
>var AProc: TDLLProcedure;
>begin
>
> @Proc := GetProcAddress(HInstance, AProcName);
>
> if @Proc <> nil then
> Proc
> else
> ShowMessage('I don't think so!');
>
>end;
>
>Thank you
>
>Kenneth Lewis
>Travel Technologies Group
>
>
>
>
>
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads