C++ and C# calling each other

  • Thread starter Thread starter droll
  • Start date Start date
D

droll

i've been mulling over this for. from what i gather, a more realistic
solution to a PPC app in .netcf2 is to have a combination of C# (usually for
UI - a lot less coding is involved) and C++ (usually in a DLL of some sort
to do the low level stuff).

so i've figured out how you can call a C++ dll from C# via P/Invoke. neat!

my question is, is there a similar mechanism for a C++ dll to call some C#
code? i'm thinking there might be situations where my C++ DLL may do work
that is asynchronous and will later post the result back to the C# code.
perhaps a window message is a better way to communicate? how do people do
this? or is it rare and almost unnecessary for C++ to call C# in practice? i
don't want to go down a path of endless nightmares and
back-to-the-drawing-board scenarios.
 
A window message or a message queue are typically good mechanisms for this.
There's no way to do a direct call.

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate
 
Back
Top