Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
4.50/5 (2 votes)
See more:
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;
    }
}


i done all the step to make the dll to be used in VB.
Posted
Updated 31-May-11 8:32am
v2
Comments
R. Hoffmann 31-May-11 14:33pm    
Edit: formatted code and added category tags.

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.
 
Share this answer
 
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/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900