Click to See Complete Forum and Search --> : DAO asserts in a DLL's ExitInstance()


Yazan Diranieh
March 29th, 1999, 04:17 AM
I have a regular DLL that uses DAO. MFC documentation indicates that DaoAfxTerm() needs to be called in the DLL's CWinApp::ExitInstance() to correctly de-initialize the DAO. However, doing so causes as assertion and ultimately a crash from within DaoAfxTerm(). MSDN documentation claims that this bug was fixed but apparently not. I was able to overcome this bug by creating a CDaoWorkspace in my client but that's not quite acceptable since my client will not be an MFC app.


Anybody ever came across this issue? Any hints?


Cheers,

Yazan Diranieh

Daren Chandisingh
March 29th, 1999, 04:47 AM
No, it doesn't. If you check the help again, it says



"In regular DLLs, call AfxDaoTerm before the ExitInstance function, but after all MFC DAO objects have been destroyed."



Note, before and not in. That might solve your problem.

Yazan Diranieh
March 29th, 1999, 05:08 AM
Daren,


That did solve the problem. Thanks for replying!!


I was calling AfxDaoTerm() as follows:


int CTestDLLApp::ExitInstance()

{

AfxDaoTerm();

return CWinApp::ExitInstance();

}


Cheers,

Yazan