如何安装非托管共享并行程序集
作为概念证明,我尝试将虚拟 DLL 安装为共享的并行程序集。
我创建了一个嵌入版本信息资源的 .dll,创建了清单和 .cat 文件,并使用 sxs.dll 功能来 InstallAssembly(),但此函数一直返回 0x800736FD (ERROR_SXS_UNTRANSLATABLE_HRESULT:An HRESULT 无法转换为相应的 Win32 错误代码)。
(我已按照 http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/90f09d5b-0c37-47a7-8ff1-11a16e691987,2007 年 6 月 15 日星期五发布上午 10:25,严格遵循 MSDN http://msdn.microsoft.com/en-us /library/aa374228%28v=vs.85%29.aspx)
编辑:解决方案 我发现代码在 Windows XP 上可以工作,但在 Vista 和 Windows 7 上会失败并出现此错误。我调试了 sxs.dll 发现 COM 函数返回错误 0x800401F0(CO_E_NOTINITIALIZED:CoInitialize 尚未被调用。)添加 CoInitialize(0) 调用一切正常。
As a proof of concept I am trying to install dummy DLL as a shared side-by-side assembly.
I have created a .dll vith embedded version info resource, created manifest and .cat file, and used sxs.dll functionality to InstallAssembly() but this function kept returning 0x800736FD (ERROR_SXS_UNTRANSLATABLE_HRESULT:An HRESULT could not be translated to a corresponding Win32 error code).
(I have followed steps from "Part 1" of http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread/90f09d5b-0c37-47a7-8ff1-11a16e691987 , post from Friday, June 15, 2007 10:25 AM, which closely follow instructions from MSDN http://msdn.microsoft.com/en-us/library/aa374228%28v=vs.85%29.aspx)
EDIT: solution
I have found out that the code does work on Windows XP but fails with this error on Vista and Windows 7. I have debugged sxs.dll to find out that COM function is returning error 0x800401F0 (CO_E_NOTINITIALIZED:CoInitialize has not been called.) After adding CoInitialize(0) call all works.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这完全不能解决问题,但 0x90092004 意味着“找不到对象或属性” - 我通过以下方式找到了这个:
This totally doesn't solve it, but 0x90092004 means "Cannot find Object or Property" - I found this by: