
Problems with DAO in a DLL
Here is the scenario:
I have a VB app that uses DAO. This app calls two VC DLLs, each of which
use DAO. My app crashes on exit. It asserts on a line that tells me that my
DLL must call AfxDAOTerm. If I override ExitInstance in each of my DLL's
app classes and put AfxDaoTerm before calling the base class, it still
crashes, although in a different line.
As far as I can think, the problem is in the fact that MFC keeps one DAO
Engine object per applications (so the doc says). Is this one per DLL, or
one per EXE? What about if the EXE is a VB EXE? Does MFC get its Engine
from the EXE, or does it create a new one for my VC DLLs? If so, is it one
per DLL or one for both DLLs? If I terminate the DAO stuff in each of my
DLLs, am I not terminating the same thing twice? How can I ensure that I
terminate DAO properly without depending on the DLL unloading mechanism?
I'd appreciate any help......
--
Marcos Garcia