ADO and 'Unhandled exception in <application> (MSDART.DLL) 0xC0000005: Access Violation'
-
Hi, I'm trying to create an extension dll that references a database via ADO, using VC 6(SP 5). The problem comes when the application is exited and it prints the following error: 'Unhandled exception in (MSDART.DLL) 0xC0000005: Access Violation' This happened two times. Once when i try to release 'Connection' or 'Recordet', second after my dll's db's class destructor, if i comment Releasing. I was trying with three Mdacs. 2.7,2.7SP1, and 2.8. with 2 OSs. 2k(SP4) and XP(SP1) but none of them resolved my problem. I'm Sure that 'CoUninitialize' wasn't called before releasing, becouse if I call "CoInitialize" ,before releasing, the return value is "S_FALSE", which mean "The COM library is already initialized on this apartment". I'll be glad to see any ideas and pointers. Best Regards: KalliMan. a
-
Hi, I'm trying to create an extension dll that references a database via ADO, using VC 6(SP 5). The problem comes when the application is exited and it prints the following error: 'Unhandled exception in (MSDART.DLL) 0xC0000005: Access Violation' This happened two times. Once when i try to release 'Connection' or 'Recordet', second after my dll's db's class destructor, if i comment Releasing. I was trying with three Mdacs. 2.7,2.7SP1, and 2.8. with 2 OSs. 2k(SP4) and XP(SP1) but none of them resolved my problem. I'm Sure that 'CoUninitialize' wasn't called before releasing, becouse if I call "CoInitialize" ,before releasing, the return value is "S_FALSE", which mean "The COM library is already initialized on this apartment". I'll be glad to see any ideas and pointers. Best Regards: KalliMan. a
I'm sure there's something in the MSKB about this or related issues; something to do with what you can and can't call from the DLL termination function. It sounds like a dependency problem, trying to unload yours after MSDART unloads or something similar... Steve S
-
I'm sure there's something in the MSKB about this or related issues; something to do with what you can and can't call from the DLL termination function. It sounds like a dependency problem, trying to unload yours after MSDART unloads or something similar... Steve S
Hi Steve, Thanks for your advice, but after 3 days search on net I could not find anything which may help me. I found that I'm not the first with this problem, too. see 'http://forums.devshed.com/t36005/s.html'. Same problem, but no answer. I cannot unload "MSDART.dll" before mine, because it's a SYSTEM dll.I have no access. (I get only ACCESS Violation:))) ). I just know its description: "Microsoft Data Access - OLE DB Runtime Routines". bla bla... Has anybody some other Ideas? a
-
Hi Steve, Thanks for your advice, but after 3 days search on net I could not find anything which may help me. I found that I'm not the first with this problem, too. see 'http://forums.devshed.com/t36005/s.html'. Same problem, but no answer. I cannot unload "MSDART.dll" before mine, because it's a SYSTEM dll.I have no access. (I get only ACCESS Violation:))) ). I just know its description: "Microsoft Data Access - OLE DB Runtime Routines". bla bla... Has anybody some other Ideas? a
In that case, I'd be tempted to get the XP symbols and get a proper callstack for this to see where it's occurring, like in your DllMain, your app's WinMain, or whatever. I wasn't implying that YOU were unloading MSDART, just that it was being unloaded first. As a hack you might try and add a method to your DLL that allows you to cleanup any or all of your objects before you unload the DLL (if you're unloading explicitly anyway, you can put a call in to do this at that point). That would help you tell if it's related. Steve S
-
In that case, I'd be tempted to get the XP symbols and get a proper callstack for this to see where it's occurring, like in your DllMain, your app's WinMain, or whatever. I wasn't implying that YOU were unloading MSDART, just that it was being unloaded first. As a hack you might try and add a method to your DLL that allows you to cleanup any or all of your objects before you unload the DLL (if you're unloading explicitly anyway, you can put a call in to do this at that point). That would help you tell if it's related. Steve S
I thing, i found my solution. Im my case the problem was, that I'm Using A Global DBManager's classes Variable, from DLL which Load my DB DLL. Immediatly when I make it member in each class where used, the problem DISAPPEAR, Both DLL, are "implicted Linked"(i.e. export classes with (__declspec(dllimport))). Strange, isn't it? P.S. Avrything was Clear. Evrething was Released ... . KalliMan. a