AxInterop.TeeChart.dll和Interop.TeeChart.dll注册的问题
我有两个应用程序都使用了图表控件,然而我卸载了其中一个软件,另一个就会报"System.Runtime.InteropServices.COMException (0x80040154): Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))",重新安装就没有异常。
后来我想在程序里面注册,但是注册两个都无法成功,提示找不到DllUnregisterServer入口点。
代码如下:
public FormMDIParent()
{
RegistryKey rkTest = Registry.ClassesRoot.OpenSubKey("CLSID\\{B6C10482-FB89-11D4-93C9-006008A7EED4}\\");
string pathdll = "/u D:\\wanwei\\Mysoft\\Thermograph\\C#_TEMPerLive\\C#_TEMPerLive\\TEMPerLive\\obj\\x86\\Release\\Interop.TeeChart.dll";
if (rkTest == null)
{ //Dll没有注册,在这里调用DllRegisterServer()吧}
ReagDll(pathdll);
pathdll = "/u D:\\wanwei\\Mysoft\\Thermograph\\C#_TEMPerLive\\C#_TEMPerLive\\TEMPerLive\\obj\\x86\\Release\\AxInterop.TeeChart.dll";
ReagDll(pathdll);
}
InitializeComponent();
}
public void ReagDll(string path)
{
Process p = new Process();
p.StartInfo.FileName = "Regsvr32.exe";
p.StartInfo.Arguments = path;//路径中不能有空格
p.Start();
p.WaitForExit(5000);
}
还有我在计算机注册表里面也找不到CLSID中图表控件注册dll ID。