title: .NET class as callback object in COM DLL
body: <p>I am a relative newcomer to Windows programming and VB.net.   What we are trying to do is call a function in an existing, 3rd party COM dll.  This function requires a callback parameter, whose type is an interface also defined in the dll.</p>
  
  <p>In our VB.net application, we have added the dll as a COM reference, and created a class that implements the interface in the DLL.  We then send an object of that type as the callback parameter.  This compiles fine.  However, when we run the application, we receive an error stating that the program is unable to cast the object from our existing type to the interface type.</p>
  
  <p>I suspect that there is a simple fix, but so far, my efforts to find a solution have come up short.  If anyone could point me in the right direction, I'd be very grateful.</p>
  
  <p>Thanks very much.</p>