Problem registering (0x000003e6)
-
I have just created an empty COM DLL with support to MFC using VC++5.0. When complied, it fails to register. Regsvr32: LoadLibrary(".\Debug\testxyz.dll") failed. GetLastError returns 0x000003e6. I looked up for the error message and it is "Invalid access to memory location" Thanks for your help in advance.
-
I have just created an empty COM DLL with support to MFC using VC++5.0. When complied, it fails to register. Regsvr32: LoadLibrary(".\Debug\testxyz.dll") failed. GetLastError returns 0x000003e6. I looked up for the error message and it is "Invalid access to memory location" Thanks for your help in advance.
Put a breakpoint in
DllRegisterServer()
. And if you don't export such function, well eh.. now you know!:cool:
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
-
Put a breakpoint in
DllRegisterServer()
. And if you don't export such function, well eh.. now you know!:cool:
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
-
I tried putting a break point in DLLRegisterServer but it doesnot stop there.. Just to clarify once more this error is poping after linking while registering ActiveX Control.. Thanks
The custom build-step in VC does a regsvr32 component.dll which in fact loads the component and calls DllRegisterServer() on it. If it doesn't reach DllRegisterServer(), that's because the problem lies where the COM component itself is loaded, or during the initialisation of the global vars of your COM component. In other words, your component links with .lib libraries. Some of these libraries export functions and thus the associated .dll file is loaded automatically by the COM component. That's where the problem is. Either you've got a missing DLL the system is trying to load (the error is sometimes weird by the way), or it loads one of the DLLs which executes wrong code in their DllMain() entry point. What should do now is isolate the code. Use dependancy walker and list all DLLs. Then for each dlls, do a small program that loads them (::LoadLibrary() should be enough). Or if you know how to use it, use RunDll32.exe (Windows 9X) or DllHost.exe (2K/XP). To get to know if the error is because of one of your global vars, just try loading a stripped down version of your component (all linked code removed) by doing a simple ::LoadLibrary(). Good luck!!!!:cool:
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
-
The custom build-step in VC does a regsvr32 component.dll which in fact loads the component and calls DllRegisterServer() on it. If it doesn't reach DllRegisterServer(), that's because the problem lies where the COM component itself is loaded, or during the initialisation of the global vars of your COM component. In other words, your component links with .lib libraries. Some of these libraries export functions and thus the associated .dll file is loaded automatically by the COM component. That's where the problem is. Either you've got a missing DLL the system is trying to load (the error is sometimes weird by the way), or it loads one of the DLLs which executes wrong code in their DllMain() entry point. What should do now is isolate the code. Use dependancy walker and list all DLLs. Then for each dlls, do a small program that loads them (::LoadLibrary() should be enough). Or if you know how to use it, use RunDll32.exe (Windows 9X) or DllHost.exe (2K/XP). To get to know if the error is because of one of your global vars, just try loading a stripped down version of your component (all linked code removed) by doing a simple ::LoadLibrary(). Good luck!!!!:cool:
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
Really appreciate you taking time and explaining. Thank you. I have created this COM component using the wizard. After the wizard is completed I have not added any methods or any code manually to this project. I simply compiled it and that's when I get this message. So If I understand your feedback correctly, some of the libraries that the the project has linked are missing or cannot load.. How can I investigate which Dll is having problem with ? Thanks once again.
-
Really appreciate you taking time and explaining. Thank you. I have created this COM component using the wizard. After the wizard is completed I have not added any methods or any code manually to this project. I simply compiled it and that's when I get this message. So If I understand your feedback correctly, some of the libraries that the the project has linked are missing or cannot load.. How can I investigate which Dll is having problem with ? Thanks once again.
ssirisha wrote: I have created this COM component using the wizard. So you probably haven't added any features from external libraries yet. Do you ? If that's the case, then you may also get the problem if you use the wizard to create an ActiveX or ATL component, with no custom implementation inside. Tried it ? I would suggest that if this code linking and registering is fine, that you start adding code from this point, until you reach the error. That may speed up a little bit code isolation. Otherwise, as I said, I would load each external library separately with a ::LoadLibrary().
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
-
ssirisha wrote: I have created this COM component using the wizard. So you probably haven't added any features from external libraries yet. Do you ? If that's the case, then you may also get the problem if you use the wizard to create an ActiveX or ATL component, with no custom implementation inside. Tried it ? I would suggest that if this code linking and registering is fine, that you start adding code from this point, until you reach the error. That may speed up a little bit code isolation. Otherwise, as I said, I would load each external library separately with a ::LoadLibrary().
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.