对于进程内的COM服务来说,如果将组件注册到这个位置(InProcServer):
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID
{CLSID}
InprocServer
(Default) = FullPathFile.DLL
在WIN32系统中,调用CoGetClassObject(...)或CoCreateInstance(...)函数可能会返回"没有注册类别"错误,这是因为"The 32-bit and 64-bit in-process servers should use the InprocServer32 entry".所以WIN32中,应使用InProcServer32而不是InProcServer.
不过,如果你的组件是本地服务,你可以注册到:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID
{CLSID}
LocalServer
(Default) = FullPathFile.EXE
即使在WIN32系统中,也是可以的.原因如下:
"If you are implementing classes as services, you should be aware that the LocalService named value is used in preference to the LocalServer32 key for local and remote activation requests—if LocalService exists and refers to a valid service, the LocalServer32 key is ignored."
详情参考msdn.
转载于:https://blog.51cto.com/jetyi/671552
本文详细解释了在Windows系统中,对于进程内COM服务的注册方式及其在不同场景下的应用差异,特别是针对本地服务与Win32系统环境下,InProcServer与InProcServer32的区别与正确使用方法。通过分析注册键值的配置,旨在帮助开发者避免常见错误,确保服务的正确加载与运行。
4791

被折叠的 条评论
为什么被折叠?



