Using COM / ActiveX Without Registering It in the System Registry

Overview

COM and ActiveX components are traditionally registered in the Windows system registry so that the corresponding Windows API functions can locate the modules (DLL or EXE) that implement the components.

However, this approach has two major limitations:

  1. Lack of privileges – the user may not have sufficient permissions to write to the system registry.
  2. Portability issues – registering COM components contradicts the idea of portable, installation-free applications.

Solution

BoxedApp SDK eliminates these limitations by allowing applications to register COM and ActiveX components inside a virtual registry.

This means you can use COM objects even when the application:

  • runs without administrative privileges,
  • does not modify the system registry,
  • and needs to remain fully self-contained.

API Functions

Two SDK functions are responsible for registering COM components in the virtual registry:

Once registered, COM and ActiveX objects can be created normally — as if they were registered in the system registry.

Example

void main()
{
  BoxedAppSDK_Init();
 
  // Register COM DLL in the virtual registry
  BoxedAppSDK_RegisterCOMLibraryInVirtualRegistry(_T("MyComLibrary.dll"));
 
  // Register COM EXE server in the virtual registry
  BoxedAppSDK_RegisterCOMServerInVirtualRegistry(_T("MyComServer.exe /RegServer"));
 
  // Now you can create COM objects without system registration
  IUnknown* pObj = NULL;
  CoCreateInstance(CLSID_MyComponent, NULL, CLSCTX_ALL, IID_IUnknown, (void**)&pObj);
}
begin
BoxedAppSDK_Init();
 
// Register COM DLL in the virtual registry
BoxedAppSDK_RegisterCOMLibraryInVirtualRegistry('MyComLibrary.dll');
 
// Register COM EXE server in the virtual registry
BoxedAppSDK_RegisterCOMServerInVirtualRegistry('MyComServer.exe /RegServer');
 
// Create COM object as usual
CreateOleObject('MyComponent.Object');
end;

Benefits

  • No administrator privileges required
  • No system changes (registry remains untouched)
  • Works for both DLL-based and EXE-based COM servers
  • Ideal for portable applications or sandboxed environments

See Also