Callback from Com Dll to CSharp method

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Is this possible - to call a C# method from a COM Dll?

I wanted to send the COM dll the address of a C# function so I could call it
back. (This was originally written in C then C++).

Or, do I need to add events to the COM dll and C# can capture those?

Thanks!

Bob
 
If you have a COM component that accepts a function pointer for callbacks
then you can indeed use that from your managed code. I would suggest using a
pinned object just in case the garbage collector does its stuff before you
get your callback.
 

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

Back
Top