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.

Re: C++ and C# calling each other by Chris

Chris
Wed Nov 23 14:00:42 CST 2005

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


"droll" <droll@invalid.com> wrote in message
news:egI3IdG8FHA.476@TK2MSFTNGP15.phx.gbl...
> 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.
>



Re: C++ and C# calling each other by Daniel

Daniel
Wed Nov 23 15:40:56 CST 2005

...yup, any of the standard IPC mechanisms also work for calling native from
managed code:
http://www.danielmoth.com/Blog/2004/09/ipc-with-cf-on-ce-part-1.html

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

"Chris Tacke, eMVP" <ctacke@spamfree-opennetcf.org> wrote in message
news:%239AKXiG8FHA.1248@TK2MSFTNGP14.phx.gbl...
>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
>
>
> "droll" <droll@invalid.com> wrote in message
> news:egI3IdG8FHA.476@TK2MSFTNGP15.phx.gbl...
>> 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.
>>
>
>




Re: C++ and C# calling each other by droll

droll
Wed Nov 23 19:18:14 CST 2005

thanks guys. :)