What is the difference between RegSvr and RegServer?

Why is there a difference in registering a COM component for 32-bit and 64-bit operating systems? On a 32-bit OS:

RegSvr32 COM.exe 

or

 RegSvr32 COM.dll 

On a 64-bit OS:

 COM.exe /RegServer COM.exe /RegSvr 

Are they the same or different if different why / how?

+7
registration com
source share
2 answers

There are significant differences in the 32-bit and 64-bit registry.

Windows 64-bit registry vs 32-bit registry

In particular, you cannot register a 64-bit DLL with regsvr32 .

http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/f8898224-76ca-4047-90d3-20c63f71a2d8/

+1
source share

COM servers register the same on 32-bit 64-bit operating systems. The question is related to self-registration, the easiest way to register a COM server is by asking the server to update the HKLM / HKCR registry accordingly.

Since you cannot run the DLL directly, you are using the regsvr32 helper application. To shorten the long history, it turns out whether the DLL is 32-bit or 64-bit and uses the appropriate version of the application. Then it loads the DLL and transfers control to register.

COM EXE servers can be started directly, so this is what you pass to them / regserver or / unregserver.

The methods are valid for 32-bit and 64-bit COM servers for 32-bit and 64-bit operating systems.

Further reading - Self-registration :

If the server is packaged in a DLL module, the DLL must export the DllRegisterServer and DllUnregisterServer functions. Any application that wants to instruct the server to register (that is, all of its CLSIDs and type library identifiers) can get a pointer to the DllRegisterServer through the GetProcAddress function. Inside the DllRegisterServer DLL, it creates all the necessary registry entries, keeping the correct path to the DLL for all InprocServer32 or InprocHandler32 entries.

When an application wants to remove a component from the system, it must unregister this component by calling DllUnregisterServer. Inside this call, the server deletes exactly those records that it previously created in the DllRegisterServer. The server should not blindly delete all records for its classes, because other software may store additional records, such as the TreatAs key.

If the server is packaged into an EXE module, the application that wants to register the server starts the EXE server with the command line argument / RegServer or -RegServer (case insensitive). If the application wants to unregister the server, it starts the EXE with a / UnregServer or -UnregServer command line argument. The self-registering EXE detects these command line arguments and invokes the same operations as the DLL in the DllRegisterServerand DllUnregisterServer, respectively, registering its module path with LocalServer32 instead of InprocServer32 or InprocHandler32.

+4
source share

All Articles