iconnectionpoint

Connect to COM events in C# - support both managed and unmanaged servers

Hi, I'm writing C# code that needs to connect to COM events. I implemented the use of IConnectionPointContainer and IConnectionPoint thus: IConnectionPointContainer connectionPointContainer = internalGenerator as IConnectionPointContainer; if (connectionPointContainer == null) { Debug.Fail("The script generat...

How do I do ConnectionPoint in Delphi?

I'm writing a DLL which talks to Excel via its IDispatch interface. From VBA I pass in a Variant containing Application.Caller from which I draw the IDispatch pointer via .pDispVal. What I'd like to know is how to query the interface via that IDispatch pointer. I want to set up a connection point container, and from there find a connec...

Automation object leaks memory (TConnectionPoints)

I have an automation object with event support that leaks memory. The FConnectionPoints which comes with the generated source is never freed. When I manually add FConnectionPoints.Free in the destructor, the leak goes away. Is this a bug in the Delphi code template, am I doing someting wrong, or is it intended to free FConnectionPoints ...

E_ACCESSDENIED exception when attaching to an event in a COM server from .NET

I have a C++/ATL COM server that implements IConnectionPoint events. My client is a C# application that attaches to the events. When the COM server is created as a SYSTEM service, the client can properly attach to the event. When the COM server is created as a LocalService service (preferred), then I get an E_ACCESSDENIED exception wh...

What is IconnectionPoint and EventHandling

Trying to understand What is IConnectionPoint and how this is connected to IConnectionPointContainer,IEnumConnectionPoints,IEnumConnections and EventHandling. Read the artcicles from MSDN and CodeProject which is explaining a about other methods like: QueryInterface() and otherthings. I am unable to figure out how all these things(ICo...

InvalidCastException when setting up handler for COM event

I have an unmanaged C++ COM server that is setup to fire events, and i am trying to handle these events from my C# app. However, I get an InvalidCastException when setting up the handler myCOMObj.MyCOMEvent += new MyCOMSource_MyCOMEventHandler(handler); The stack trace shows: Specified cast is not valid. at System.Runtime.Inter...