Current-User Registration for ActiveX Servers

From RAD Studio
Jump to: navigation, search

Go Up to Creating Simple COM Servers Index

When you register an ActiveX server, you can choose to register it for all users or per-user (that is, for any user or for yourself as the current user). The Unregister command, however, unregisters for both "Current-User" and "All Users" simultaneously; there is no per-user unregistration in the IDE.

Per-user registration:

  • Is useful if you are debugging or are using a PC for which you do not have Administrator rights.
  • Enables you to deploy and register your COM servers on Windows 7 machines that have UAC enabled.

To register an ActiveX server for the current user only

  1. Create an ActiveX server.
  2. Choose Run > ActiveX Server > Register for Current User.

To unregister an ActiveX server

  • Choose Run > ActiveX Server > Unregister.
  • A single Unregister command unregisters the selected ActiveX server for both:
    • The current user
    • All users

Using TRegSvr to Unregister for the Current User

You can perform 'Current User' and 'All Users' registration and unregistration by using TRegSvr.exe, a command line tool that is delivered in the \bin directory of your product installation.

Note: The IDE, being a 32-bit process, cannot register 64-bit in-proc/DLL servers (32-bit processes cannot load 64-bit DLLs). To register 64-bit in-proc servers, you must use the 64-bit version of TRegSvr.exe, located in $(BDS)\bin64\TRegSvr.exe.

To unregister for the current user

  • On the command line, enter:
> tregsvr -c -u MyTypeLib.tlb
Specifying the -c and -u options together unregisters the type library or DLL for the current user only.

See Also