我一直在尝试按照说明安装Windows SDK附带的示例VSS硬件提供程序。不幸的是,COM拒绝注册DLL,给出以下输出:
Unregistering the existing application...
- Create the catalog object
- Get the Applications collection
- Populate...
- Search for VssSampleProvider application...
- Saving changes...
Done.
Creating a new COM+ application:
- Creating the catalog object
- Get the Applications collection
- Populate...
- Add new application object
- Set app name = VssSampleProvider
- Set app description = VSS HW Sample Provider
- Set app access check = true
- Set encrypted COM communication = true
- Set secure references = true
- Set impersonation = false
- Save changes...
- Create Windows service running as Local System
- Add the DLL component
ERROR:
- Error code: -2146368511 [0x80110401]
- Exit code: 113
- Description:
- Source:
- Help file:
- Help context: 0
- COM+ Errors detected: (2)
* (COM+ ERROR 0) on C:VssSampleProviderVssSampleProvider.dll
ErrorCode: -2146368486 [0x8011041A]
MajorRef: C:VssSampleProviderVssSampleProvider.dll
MinorRef: invalid
* (COM+ ERROR 1) on SampleProvider
ErrorCode: -2146368486 [0x8011041A]
MajorRef: {423BBC78-9B20-4BBE-A967-B63EC43BC7F3}
MinorRef: invalid
这与本线程中描述的问题相同:
http://www.osronline.com/showthread.cfm?link=185213
我试过同时使用x86和x64机器,但没有什么区别。欢迎任何提示或建议。
这需要msvcr110.dll和msvcp110.dll。这些文件附带"Visual C++Redistributable Packages"。您可以在以下链接获取最新的"Visual C++可再发行包"。http://www.microsoft.com/en-in/download/details.aspx?id=40784
我最终解决了这个问题。事实证明,你只能在windows服务器发行版上安装硬件提供程序,我使用的是普通的Windows7。有关API调用:,请参阅MSDN页面
http://msdn.microsoft.com/en-us/library/windows/desktop/aa381923(v=vs.85).aspx
在windows server 2012机器上编译64位并使用带有SDK的64位工具似乎可以正常工作。