Re: New to DLLs
From: J French (erewhon_at_nowhere.com)
Date: 09/15/04
- Next message: Alistair George: "Re: Stymied by loss of application paths"
- Previous message: J French: "Re: Again on kb_event. It almost works"
- In reply to: Jessica Loriena: "Re: New to DLLs"
- Next in thread: Maarten Wiltink: "Re: New to DLLs"
- Reply: Maarten Wiltink: "Re: New to DLLs"
- Reply: Bjørge Sæther: "Re: New to DLLs"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 15 Sep 2004 08:08:34 +0000 (UTC)
On 14 Sep 2004 21:03:52 -0700, jloriena@hotpop.com (Jessica Loriena)
wrote:
>Great explanation! I'm finally getting to know a little more about
>DLLs.. Thanks a million!
Rob's advice was spot on
How I generally do it is to have an Array of Objects in the main Unit
of the DLL
The: SomeDllCreate checks for an unused member of the Array, then
creates that Object and returns the number of the Object in the Array
as the 'Handle'
>From then on the EXE passes the 'Handle' to the DLL as the first
parameter, in the DLL
Procedure DoSomething( Const Handle :Integer );StdCall;
Begin
ObjArray[ Handle ].DoSomething;
End;
Another thing, passing back Strings from a DLL is not a good idea,
however they can be passed back very nicely as strings in OleVariants
This is because OleVariants use a different (shared) system for memory
allocation, and when returned as the Result of a Function, they are
really an extra hidden parameter sent in from the caller.
- Next message: Alistair George: "Re: Stymied by loss of application paths"
- Previous message: J French: "Re: Again on kb_event. It almost works"
- In reply to: Jessica Loriena: "Re: New to DLLs"
- Next in thread: Maarten Wiltink: "Re: New to DLLs"
- Reply: Maarten Wiltink: "Re: New to DLLs"
- Reply: Bjørge Sæther: "Re: New to DLLs"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|