locked
OOP COM Server registration RRS feed

  • Question

  • Hello,

    I have developed an OOP COM server using ATL to wrap a 32 bit dll that is used by a 64 bit app.

    This is being registered under HKEY_CURRENT_MACHINE which required admin rights. I would like to get this to register in a way that does not require admin rights such as per user.

    Is there a way to do this, if so how can I do it?

    Thanks.

    Thursday, June 12, 2014 12:42 AM

Answers

  • You can register them as per user, this means that you write to HKCU\Software\Classes. But as this implies, this will server will be visible only to the current user. There is no way to register it globally without admin privileges.


    This is a signature

    Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.


    Thursday, June 12, 2014 6:17 AM

All replies

  • Hello,

    I have developed an OOP COM server using ATL to wrap a 32 bit dll that is used by a 64 bit app.

    This is being registered under HKEY_CURRENT_MACHINE which required admin rights. I would like to get this to register in a way that does not require admin rights such as per user.

    Is there a way to do this, if so how can I do it?

    Thanks.

    First off I'll remind you that a 64-bit application cannot load a 32-bit DLL, even if that DLL is a COM DLL. A very good solution would be to load the 32-bit COM DLL into component services, assuming that it conforms to the restrictions of COM+. This means it will run as a 32-bit executable, and through DCOM a 64-bit client can call into a 32-bit COM+ DLL. Registering a COM+ server will require administrator privileges; there is no way around this.

    For 32-bit COM DLL's, it is possible to use Registration-Free Activation so that it is callable by 32-bit clients. For more information, read this.

    Thursday, June 12, 2014 2:15 AM
  • Thank you for your Reply Brian,

    My server is actually a 32 bit COM server executable that wraps the 32 bit dll for the 64bit client.

    Not sure if this is best way to do this but my app must be 64 bit and the dll must be 32 bit :-).

    So it looks like there is no way to register these COM servers without admin privilages then?

    I will look into doing it the way you suggest using component services but it does not help me with the privileges issue.

    Thanks anyway.

    Thursday, June 12, 2014 2:42 AM
  • You can register them as per user, this means that you write to HKCU\Software\Classes. But as this implies, this will server will be visible only to the current user. There is no way to register it globally without admin privileges.


    This is a signature

    Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.


    Thursday, June 12, 2014 6:17 AM
  • Thank you Crescens2k. I will look into doing it that way too.
    Thursday, June 12, 2014 6:32 AM