Dll Won't register

I wrote a gadget that uses a C++ dll as an ActiveX object. The dll was written in VS2005 on an XP pro machine using Bruce Williams tutorial as a guide. It registers fine in XP (using regsvr32 and manually registering it in my gadget) and when I open my gadget.html in IE it works as it should. When I move the gadget over to my shiny new vista machine (Business edition) the DLL can't register. I can write the appropriate values to HKCU manually in the gadget, but it still gives me an error when I try to create the ActiveX object containing my class and regsvr32 gives me errors about the side-by-side configuration. I've tried it as both administrator and standard user. Does anyone have any insight about how to register my DLL

Thanks



Answer this question

Dll Won't register

  • Ken Knowles

    regsvr32 won't work on a .NET DLL. You'll need to use regasm:
    "c:\windows\Microsoft.NET\Framework\v2.0.50727\regasm.exe" <dll filename> /codebase

    You can also use regasm to get the registry entries. ie

    "c:\windows\Microsoft.NET\Framework\v2.0.50727\regasm.exe" <dll filename> /codebase /regfile:regentries.reg

    If you want to include it in your Gadget, use the example script I posted here to register it. If you've elevated yourself, the DLL won't work when registered in HKCU, the script catches this and puts it into HKLM, if HKCU fails.


  • SN Ngaihte

    the side by side registration is failing because you are not installing the correct dlls with your activex control. Look in control pane->administrative tools->Event Viewer, and you will see why it is failing, and which DLL. It's probably ATL.dll or msvcr...dll

    Dan


  • vikram vilasagaram

    Thanks Dan, that was the problem. I had to install the VS2005 redistribution pack on to my vista machine. I no longer get an error when I create the activeX object, but I did start getting a "Error in Loading DLL" when I try to access the functions of my DLL. If you guys have any ideas on that one, I'd love to hear them. This gadget is coming to life one line of code at a time . Thanks again.
  • Dll Won't register