简体   繁体   English

COM类可见性:C#到VB6

[英]COM class visibility: C# to VB6

I have a C# .Net 4.0 Application on the one hand and on the other a VB6 App. 我一方面有一个C#.Net 4.0应用程序,另一方面有一个VB6应用程序。 I created a COM Interface by making the Project COM Visible and actived register COM Interop. 我通过使Project COM Visible和actived寄存器COM Interop创建了一个COM接口。

I Tested the COM interface by implementing a C# Application wich imports the new tlb file. 我通过实现导入新tlb文件的C#应用​​程序来测试COM接口。 All seems to be fine. 一切似乎都很好。

As next step I tried to use the dll with vb6. 下一步我尝试将dll与vb6一起使用。 The dll could be loaded but now i can't see all public classes. 可以加载DLL,但现在我看不到所有公共类。 In C# I see 4 classes in vb6 I can only see 3. 在C#中我看到vb6中的4个类我只能看到3个。

The class I can't see is a "special" one cause it impelements an interface and serves events. 我看不到的类是一个“特殊”类,因为它会触发一个接口并提供事件。

The class is marked with 该课程标有

[ComSourceInterfaces(typeof(COMEvents))]

and the COMEvents interface is like 和COMEvents接口就好

[Guid("11947063-4665-4DE1-931D-9915CCD01794")]
[InterfaceType(ComInterfaceType.InterfaceIsIDispatch)]
    public interface COMEvents 
    {
        void MethodOne();
        void MethodTwo();
    }

I have to say that all worked fine. 我不得不说一切都很好。 Than i added a project which only effects other assemblys wich are loaded on runtime by the COM interface project. 比我添加了一个项目,它只影响COM接口项目在运行时加载的其他程序集。 They implement an interface which changed. 他们实现了一个改变的界面。 Thats the only change i made to the com interface is adding additonal parameter to a method. 这是我对com接口所做的唯一更改是向方法添加additonal参数。

Why can't I see the Class any more? 为什么我不能再看到班级了? And why is it only the class I changed but in no "risky" way? 为什么只有我改变的课程,但没有“冒险”的方式?

need help thanks! 需要帮助谢谢!

PS: I Tried up to now: -> all Project are Build x86 -> Project Build on x86 Machine -> Dependency Walker(GPSVC.DLL and IESHIMS.DLL are missing but they did also before and i don't think they have anny effect cause the tlb is build and could be loaded) -> tryied tlbexp.exe but get an dependencie error cause assambly runtime is newer than current one. PS:我到现在为止尝试: - >所有项目都是构建x86 - > x86机器上的项目构建 - >依赖性Walker(GPSVC.DLL和IESHIMS.DLL都丢失但他们之前也做过,我认为他们没有anny效果导致tlb构建并且可以加载) - >尝试tlbexp.exe但得到依赖性错误导致assambly运行时比当前运行时更新。 wtf?) WTF?)

发现它...具有2个参数的构造函数,VB6不支持具有多个零参数的构造函数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM