|
|
Clarion Language and Runtime Library
Started by DirkC at 09-10-2008 10:26 PM. Topic has 3 replies.
 
 
|
|
Sort Posts:
|
|
|
|
09-10-2008, 10:26 PM
|
DirkC
Joined on 09-10-2008
Posts 3
|
DllMain Procedure in a DLL
|
|
|
|
|
Hi All
I am trying to create a “DllMain” procedure in a dll this would allow me to dispose of some threaded variables that was created during a session on DLL_THREAD_DETACH.
My problem seems to be that you can not change the entry point for the DLL to point to the DLLMain procedure? I am using CW 6.3.9053 and the DLL is build in the AppGen with an Empty Dictionary and “Don’t generate globals” selected.
Any help or comments would be appreciated
Thanx
Dirk
|
|
|
|
|
Report
|
|
|
|
09-15-2008, 5:31 AM
|
SurfDownUnder

Joined on 10-27-2005
Dresden, Germany
Posts 48
|
Re: DllMain Procedure in a DLL
|
|
|
|
|
The easiest way to do this is to not try and create your own DllMain, rather just use the features of the Clarion language.
All you need to do is create a static threaded class and in the destructor of the class free your variables.
Eg
__CleanupCode CLASS,STATIC,THREAD Destructer PROCEDURE END
__CleanupCode.Destructer PROCEDURE CODE !Do stuff
Cheers, SuRF
SuRF
|
|
|
|
|
Report
|
|
|
|
09-15-2008, 2:29 PM
|
AlanTelford
Joined on 10-26-2005
Auckland, New Zealand
Posts 15
|
Re: DllMain Procedure in a DLL
|
|
|
|
|
Just checking, but I believe the DESTRUCTER is always called DESTRUCT, so this should be:
__CleanupCode CLASS,STATIC,THREAD Destruct PROCEDURE END
__CleanupCode.Destruct PROCEDURE CODE !Do stuff
|
|
|
|
|
Report
|
|
|
|
09-16-2008, 5:11 AM
|
DirkC
Joined on 09-10-2008
Posts 3
|
Re: DllMain Procedure in a DLL
|
|
|
|
|
|
|
|
|
|