This article was previously published under Q207132
On This Page
SUMMARY
This article describes how the RegSvr32.exe program registers and unregisters a Component Object Model (COM) dynamic-link library (DLL). You can use this information to troubleshoot errors that occur when you try to use RegSvr32.exe program with your COM DLL.
RegSvr32.exe calls the following Win32 functions in this order:
•
OleInitialize
•
LoadLibrary to load the DLL
•
DllRegisterServer or DllUnregisterServer
•
FreeLibrary
•
OleUninitialize
Most often, RegSvr32.exe fails because the LoadLibrary, DllRegisterServer, or DllUnregisterServer function fails.
LoadLibrary can fail if the DLL is not in the specified path, or if the specified path is incorrect. LoadLibrary can also fail if one of the dependencies of the DLL that you are trying to load is not met; in other words, if a dependent DLL is not present or is not in the specified path.
NOTE: You can use the Depends.exe tool to check whether or not all of the dependencies of your DLL are met. Depends.exe is included with the Microsoft Platform Software Development Kit (SDK), which ships with Microsoft Visual Studio.
Your DLL must implement DllRegisterServer and DllUnregisterServer, which contain the logic that is necessary to add or delete the required registry entries for the COM component. RegSvr32.exe finds the entry point to these functions, and calls them appropriately.
NOTE: If you use the Microsoft Active Template Library (ATL) Wizard to create the COM DLL, the Wizard generates the necessary code for DllRegisterServer and DllUnregisterServer.
If you use Microsoft Visual C++, refer to the Platform SDK sample at \Platform SDK\Samples\Com\Fundamentals\Async\Server.
Need More Help? Contact a Support professional by Email, Online or Phone.
Customer Service For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
Newsgroups Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.