Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. Problem registering (0x000003e6)

Problem registering (0x000003e6)

Scheduled Pinned Locked Moved COM
helpc++comdebuggingperformance
7 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    ssirisha
    wrote on last edited by
    #1

    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.

    S 1 Reply Last reply
    0
    • S ssirisha

      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.

      S Offline
      S Offline
      Stephane Rodriguez
      wrote on last edited by
      #2

      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.

      S 1 Reply Last reply
      0
      • S Stephane Rodriguez

        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.

        S Offline
        S Offline
        ssirisha
        wrote on last edited by
        #3

        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

        S 1 Reply Last reply
        0
        • S ssirisha

          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

          S Offline
          S Offline
          Stephane Rodriguez
          wrote on last edited by
          #4

          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.

          S 1 Reply Last reply
          0
          • S Stephane Rodriguez

            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.

            S Offline
            S Offline
            ssirisha
            wrote on last edited by
            #5

            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.

            S 1 Reply Last reply
            0
            • S ssirisha

              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.

              S Offline
              S Offline
              Stephane Rodriguez
              wrote on last edited by
              #6

              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.

              S 1 Reply Last reply
              0
              • S Stephane Rodriguez

                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.

                S Offline
                S Offline
                ssirisha
                wrote on last edited by
                #7

                No features from external libraries added. No custom implementation added. I soon as I finish with the wizard, I tried to compile. Thanks.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups