开发者

CComModule UnregisterServer error?

开发者 https://www.devze.com 2022-12-16 16:20 出处:网络
I have a CComModule that is calling RegisterServer (TRUE) on DllRegisterServer and UnregisterServer (TRUE) on DllUnregisterServer. The UnregisterServer is getting a 0x8002801C (Error 开发者_Go百科acce

I have a CComModule that is calling RegisterServer (TRUE) on DllRegisterServer and UnregisterServer (TRUE) on DllUnregisterServer. The UnregisterServer is getting a 0x8002801C (Error 开发者_Go百科accessing the OLE registry.) error and leaving around registery keys. I am using a Windows Server 2k8 R2 machine with UAC enabled. The components are x86 and I am using the 32 bit regsrv32.

Does anyone know why I would be getting this error?


You must run Regsvr32.exe from a command prompt that's elevated to administrator (i.e. UAC disabled). Make a shortcut on your desktop to "cmd.exe", right-click it and choose "Run as Administrator".


If you're using ATL and VS2008 then you can register your COM object per-user which writes the necessary registry keys to HKEY_CURRENT_USER instead of HKEY_LOCAL_MACHINE. You register your object by passing a special user switch to regsvr32, e.g.:

regsvr32.exe /i:user /n yourobject.dll 

COM servers can be registered with the /RegServerPerUser switch.

I asked a similar question.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号