Sinking events from a COM object

B

Bertil Emmertz

I want to sink events created by a COM component developed in .NET. The
component looks like follows:

public delegate void MyDelegate();

public interface IControllerProxyControl
{
Int32 GetControllers();
string GetControllerSystemName(Int32 argIndex);
string GetControllerIPAdress(Int32 argIndex);
Int32 ConnectToController(Int32 argIndex);
void DisConnectFromController(Int32 argControllerToken);
event MyDelegate MyEvent;
}

public class CControllerProxy:IControllerProxyControl
{
<The class implementation>
}

I set up a reference in Visio VBA and get the following objects:


CControllerProxy <The class implementing the interface>
IControllerProxyControl <The interface>
add_MyEvent (value as MyDelegate)
<The other methods>
remove_MyEvent (value as MyDelegate)
MyDelegate

I can create an object of the class and access the methods but I have not
been able to connect my eventhandler in Visio to the event MyEvent sofar. I
have tried to use withevents on CControllerProxy but VBA tells me that the
class has no events.

Does somebody have any hints how I can make this connection. How can I use
add_MyEvent ?

BEz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top