0

I have MFC forms program that calls the API inside the DLL and this DLL has both constructor and destructor. However these constructor and destructor are not exportable which means my MFC forms cannot call t hem. So if I exit out the MFC program, is that when DLL destructor gets called? can I choose when to call DLL destructor?

thanks.

Bopha
  • 3,296
  • 6
  • 25
  • 23
  • Do you mean you have a global variable with a constructor/destructor? If not, what do you mean by a "DLL destructor"? – Logan Capaldo Jan 30 '14 at 20:01
  • He probably means when unloading the dll. – cageman Jan 30 '14 at 20:07
  • thanks for the quick reply. So I have this DLL project and I look through the code, I see there is destructor function and inside that destructor it has other operations such as closing out the connection to the lower layer. So basically i would like to know when this destructor gets called from my MFC form. – Bopha Jan 30 '14 at 20:10
  • 1
    @Bopha - why don't you include a snippet of that code? Might help get a better response. – EkoostikMartin Jan 30 '14 at 20:11
  • @Bopha: **objects** have destructors. DLL's have `DllMain`, which is called with argument `DLL_PROCESS_DETACH` when the program exits. – MSalters Jan 31 '14 at 08:13
  • Really unclear what you are asking. Please show some code. The destructor you are talking about are for a gloabal object? – manuell Jan 31 '14 at 14:14

0 Answers0