1

I am trying to use an old ActiveX control in C#, and this line from CreateSink method

cookie = new AxHost.ConnectionPointCookie(ocx, eventMulticaster, typeof(TrueDBGridEvents));

will fail and generate an exception.

The exception is "Source object does not expose 'TrueDBGridEvents' event interface. When you look in the object browser the interface is there.

object browser

I can not find a reason why the ConnectionPointCookie will not find this interface.

R.J. Dunnill
  • 2,049
  • 3
  • 10
  • 21
  • Object Browser does not tell you anything useful, it shows the converted type library. If TrueDBGridEvents did not exist then your code would not compile. You have to look at the type library embedded in the COM component, use OleView.exe File > View Typelib command. The [uuid] attribute on the interface matters, not the name. This is a classic DLL Hell problem btw, running your program with a different version of the component will cause this exception. – Hans Passant Sep 30 '16 at 15:40

0 Answers0