Callback example -- Managed C++ and Unmanaged DLL (C++)

  • Thread starter Thread starter Kevin Talley
  • Start date Start date
K

Kevin Talley

Can someone please post a small/simple working example of doing a callback
in Managed C++?

Basically, I have a MC++ windows form client, and an unmanaged C++ DLL
(which I wrote). I have a function in MC++ client that needs to get fired
by the DLL as it "loops" thru records (it's basically looking to see if a
<Stop> button click has fired in the client).

I've found several different C#-client examples on CodeProject and CodeGuru
(and have read MSDN docs on delegates, as well as chapters in several books
dealing with P/Invoke), but can't seem to find a simple example of doing a
callback with MC++ (using DllImport) and a C++ DLL. I've tried to duplicate
the C# examples in MC++, but can't seem to find a combination that compiles
& works.

I've been doing C++ for many years (on the Borland side), but am a relative
"rookie" with .NET (and MC++) -- thus, part of the reason why the syntax and
the process is not clicking in my brain (yet <g>).

Thanks in advance...

Regards,
Kevin T.
 
Back
Top