C#Com互操作性事件 [英] C# Com Interopability Events

查看:82
本文介绍了C#Com互操作性事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我用谷歌搜索了如何在C#类中添加事件,这些事件可以在VB6.0中互操作,但找不到任何对我有帮助的文章.

如果有人之前尝试过,那么请引导我.

这是我的代码.

Hi All,

i googled how we can added events in C# class that can be interop in VB6.0 but not able to find out any article that help me.

if any one tried it before then pls guide me.

here is my code.

public interface ICalculator
{
    int Add(int Number1, int Number2); 
}

public class ManagedClass:ICalculator
{
    public int Add(int Number1,int Number2)
    {    
     // I want to raise an event here so that this event should be consumed in VB
            return Number1+Number2;
    }
}



我完成了使DLL在VB中使用的所有步骤.



i done all the step to make the dll to be used in VB.

推荐答案

请参阅本文(也是计算器):

http://social.msdn.microsoft.com/Forums/zh/vbinterop/thread/29a898df-9ee5-4cac-86bb-9693b2d64a12 [
See this article (also a calculator):

http://social.msdn.microsoft.com/Forums/en/vbinterop/thread/29a898df-9ee5-4cac-86bb-9693b2d64a12[^]

It shows C# and vb6 code, that should help you.


Ruard,

感谢您抽出宝贵的时间来提供有用的链接.

我找到了一个解释得更好的链接.
这是其他可以检出的链接.

http://www.codeguru.com/Csharp/Csharp/cs_misc/com/article .php/c6747/ [ ^ ]
Hi Ruard,

Thanks for you time for giving a useful link.

i found a link which explains better.
here is the link that will other to check it out.

http://www.codeguru.com/Csharp/Csharp/cs_misc/com/article.php/c6747/[^]


这篇关于C#Com互操作性事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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