 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Yu Xing Guest
|
Posted: Fri May 18, 2007 6:33 am Post subject: how to release resource from dll when program quits. |
|
|
Hello everyone,
I use some dlls with a exe file,but I wanna know how to release the
resource from dlls when the application quit,because I want to do some
clearing work automaticly when dll closed. Where is position I should
put my clearing code at?
thanks
yu xing |
|
| Back to top |
|
 |
Bruce Salzman Guest
|
Posted: Fri May 18, 2007 8:10 am Post subject: Re: how to release resource from dll when program quits. |
|
|
"Yu Xing" <mail2yzx (AT) 126 (DOT) com> wrote in message
news:464d0275 (AT) newsgroups (DOT) borland.com...
| Quote: | Hello everyone,
I use some dlls with a exe file,but I wanna know how to release
the
resource from dlls when the application quit,because I want to do
some
clearing work automaticly when dll closed. Where is position I
should
put my clearing code at?
|
You might be able to use the DllEntryPoint function, depending on how
your resources are managed.
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*
lpReserved)
{
switch (reason) {
case DLL_PROCESS_ATTACH:
// allocate resource
break;
case DLL_PROCESS_DETACH:
// release resource
break;
}
return true;
}
--
Bruce |
|
| Back to top |
|
 |
Yu Xing Guest
|
Posted: Fri May 18, 2007 8:10 am Post subject: Re: how to release resource from dll when program quits. |
|
|
Bruce,
Thank you, I got what I want.
yu xing |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|