>> I am using a dll to load a form but it keeps disappearing because I have
>> a FreeLibrary in my finally clause. It loads fine, the form flashes on
>> the screen and then goes away. Do I need some kind of callback
>> function to stop it disappearing?
>> // Prototypes defined
>> try
>> hDllHandle := LoadLibrary(DllName);
>> if hdllHandle > 22 then @ExecuteProgram :=
>> GetProcAddress(hDllHandle, 'ExecuteProgram');
>> if @ExecuteProgram <> nil then ExecuteProgram;
>> finally
>> FreeLibrary(hdllHandle);
>> end;
...Edited for the sake of brevity...
> Looks like you just need some sort of loop to wait until the program ends.
> It would depend on what the function ExecuteProgram does.
Assuming that the ExecuteProgram is showing a form non-modally...
A good one would probably to give a handle as a parameter to the dll executeprogram
and then have the dll send a custom message to that handle when it's finished to
indicate that the library can now be released.
--
Aaron Scott-Boddendijk
Jump Productions
(07) 838-3371 Voice
(07) 838-3372 Fax
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz