[Spam] Re: [DUG] call a method function from outside object
Ross Levis
ross at stationplaylist.com
Mon Jul 11 21:50:34 NZST 2005
Thanks for that. I think I follow. Are you saying that the current DLL calling my procedure will be in the process stack, but the other DLL in the 2nd component not currently calling the procedure will not be in the stack? That should work. But I won't need to do this now.
Rob Kennedy from an international mailing list has just sent me a unit he wrote today which does exactly what I need. It uses ASM code to fiddle things so that a call made to a standard (cdecl) procedure address is converted to a method call. I just implemented it and it works great!
I doubt anyone else would need such as thing but I can pass it on if anyone is interested.
Regards,
Ross.
----- Original Message -----
From: Kyley Harris
To: NZ Borland Developers Group - Delphi List
Sent: Monday, July 11, 2005 8:46 PM
Subject: [Spam] Re: [DUG] call a method function from outside object
If you want only one global callback for all dlls and all instances of your component then you could do the following.
1/ When your component is created and destroyed, add and remove it from an internal TList or similar.
2/ Each time you open a dll, bind it to the same single callback which can do the following (psuedo code)
proc GlobalOpen(bla1,bla2,bla3:integer)
var
i:integer;
DLLName:string;
begin
DLLNAme := WalkCurrentProcessStackForDllName;
{Doesn't have to go far because this is always called from a dll}
for i := 0 to _List.Count -1 do
if _List[i].InterestedInDLL(DllName) then
_List[i].Open(bla1,bla2,bla3)
end;
regards
Kyley
Ross Levis wrote:
Kyley Harris wrote:
I find it interesting that your 1..2..3 option would actually work.
Generally, when there is a single procedure callback, it is not a nested
type system, so the minute the second form is opened and you attach
Open2, the link
to Open1 no longer exists, because it can only hold one method at a
time....
unless there is something missing in what you are showing us.
I was disappointed to find this was the case when using the same DLL.
I'm dealing with Winamp input plugins here so there are several DLL's to
handle different types of files, all with the same structure, so they
are interchangeable. I tried it with 2 different DLL's and it worked
fine, but the same DLL obviously doesn't. I guess there is no way to
force a second instance of the same DLL to load into 2 memory locations
without perhaps making a 2nd copy of the file and changing it's name?
Regards,
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ns3.123.co.nz/pipermail/delphi/attachments/20050711/70977119/attachment-0001.html
More information about the Delphi
mailing list