无法在注册表中注册dll [英] Unable to register a dll in the registry

查看:110
本文介绍了无法在注册表中注册dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我开发了一个C#dll和一个MFC应用程序。这个MFC应用程序正在使用dll中的函数。所以我构建代码dll是在注册表中自动注册的,但是当我在另一台机器上运行exe时,它不会在注册表中写入CLSID密钥。因此,在下面的代码中,条件失败。



注意:注册表项仅在我构建整个解决方案时才在注册表中写入。





HRESULT hr = CoInitialize(NULL);

CLSID clsid;

HRESULT hResult = CLSIDFromProgID(_T(dllfunction),&clsid);

if(FAILED(hResult))

{

AfxMessageBox(L失败);

返回;

}



所以请做我必须更改属性中的任何内容才能使其正常工作。

Hello,

I have developed a C# dll and a MFC application.The functions from the dll are being used in this MFC application.So i build the code the dll is being registered in the registries with a registry key automatically but when i run this through exe in another machine its not writing the CLSID key in the registries. Due it this in the below code the condition is getting failed.

Note: The registry key is writing in the registries only when i build the entire solution.


HRESULT hr = CoInitialize(NULL);
CLSID clsid;
HRESULT hResult = CLSIDFromProgID ( _T("dllfunction"), &clsid);
if (FAILED(hResult))
{
AfxMessageBox(L"failed");
return ;
}

So Do i have to change anything in the properties to make this work.

推荐答案

您必须明确注册(请参阅 Regasm.exe(程序集注册工具) [ ^ ])你的 DLL 在其他机器
You have to explicitely register (see Regasm.exe (Assembly Registration Tool)[^]) your DLL in the 'other machine'


这篇关于无法在注册表中注册dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆