问题描述
我负责维护一个C#应用程序的(2005 VS)。这个C#应用程序调用一个dll(MYDLL.DLL)。我需要做的有问题的DLL中的一些变化。
I'm in charge of the maintenance of a C# application (VS 2005). This C# applications calls a dll ("mydll.dll"). I needed to make a few changes on the dll in question.
我的文件mydll.vbp这是写在Visual Basic 6.0。我做了我的变化,Visual Studio和,那么,制造MYDLL从Visual Basic接口。
I have the file "mydll.vbp" that was written in Visual Basic 6.0. I made my changes in Visual Studio and, then, "made "mydll"" from the Visual Basic interface.
的问题是,现在,每次我试图实例类从MYDLL.DLL,在debbuger模式在C#中,我有以下的InvalidCastException的
The problem is that, now, at each time I try to instance a class from "mydll.dll" in debbuger mode in C#, I have the following "InvalidCastException"
无法转换类型mydll.ClassFrommydll的COM对象的接口类型mydll._ClassFrommydll。此操作失败的原因是对IID{384FB79F-B636-4655-9441-8222692AB8AE}接口的COM组件调用QueryInterface失败,原因是以下错误:不支持此接口(异常来自HRESULT:0x80004002(E_NOINTERFACE)) 。
我试图重新参考相关的DLL ...但是,这并不能改变什么。
I tried to re-reference the dll in question ... but that does not change anything.
这是它可能来自任何想法?
Any idea on what it could come from ?
许多许多感谢所有yopu的谁可以提供帮助。已经坚持了这个问题,现在天。开始感到压力......
Many many thanks to all of yopu who can help. Have been stuck with this problem for days now. Start to feel the pressure ...
推荐答案
标记主类[STAThread]
和您的问题将得到解决
mark the main class [STAThread]and your problem will be solved
这篇关于从HRESULT异常:0x80004002(E_NOINTERFACE)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!