Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I have a huge problem. I've created a COM control in c# which I wish to use in VB6. Everything is working perfectly except events.

I've created an event which I can see in my c# test harness but when I go to use the control in VB6 I see two strange methods have appeared (add_EventHandlerNameHere and remove_EventHandlerNameHere)
These both take in one parameter "value as unknown".

I can't figure out how to use these methods or how to see the event properly from with VB6. Any help would be really appreciated as I'm on a really tight schedule for this.

Many Thanks,
Kiran
Posted
Comments
Patrick Kalkman 21-Apr-11 10:21am    
No solution, but a little background information. Every COM interface must implement IUnknown. I guess that is why you see value as unknown. The method add_EventHandlerNameHere expects an instance of an class that implements IUnknown.
Bruno Tagliapietra 21-Apr-11 14:31pm    
The methods probably do the same job the operators += and -= do in c#.
Try using it thinking like this.

http://www.tek-tips.com/viewthread.cfm?qid=1298191&page=164[^]
I believe that this link will assist you more with what you hope to acheive.
 
Share this answer
 
Most likely reason is you are not implementing IDispatch. Is that so?
 
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