combining managed and unmanaged (for the 100th time)

  • Thread starter Thread starter New World Order Pigs
  • Start date Start date
N

New World Order Pigs

Sorry if this is the wrong group, but it seems like a good place to start.
I have a control, creating a dll written in c#/.net and some unmanaged code
in c++ using embedded c++ V3. Yes, it is for PPC2002/PPC2003 but I don't
believe that's the significant issue. My question is, can I create a
solution that wraps the c++ in c# and combine that with the c# control and
if so, is this the best way to combine these two elements? I'm not going to
post this elsewhere and hope people can look past the PPC issues since I
don't believe they matter at all here.

Thanks for any assistance,
NWOP.
 
6.1. How do I call a function that is in a native DLL?

Native DLL functions can be called through Platform Invoke (P/Invoke):

Learn how to use the Platform Invoke (P/Invoke) feature of the .NET Compact
Framework.

http://msdn.microsoft.com/library/en-us/dnnetcomp/html/netcfintrointerp.asp

Explore advanced interoperability on the .NET Compact Framework.

http://msdn.microsoft.com/library/en-us/dnnetcomp/html/netcfadvinterop.asp

Learn how to create unmanaged functions that you can use in your Smart
Device applications through Platform Invoke.

http://msdn.microsoft.com/library/en-us/dnnetcomp/html/unmanagedfuncs.asp

Learn how to marshal data between managed and unmanaged code using the .NET
Compact Framework.

http://msdn.microsoft.com/library/en-us/dnnetcomp/html/netcfmarshallingtypes.asp

Learn how to use dumpbin.exe as an aid for declaring P/Invokes in Microsoft
..NET Compact Framework-based applications.

http://msdn.microsoft.com/library/en-us/dnnetcomp/html/netcfdumpbinpinvoke.asp
 
Thanks Richard. Some of these things I've looked at but one thing always
seems to be missing-- I'm using an unmanaged c++ app to use a control (dll
ultimately) written with c#/.net. My understanding is that managed code is
interpreted and needs the runtime and as such, how do I take an unmanaged
app and invoke managed code. Most of what I read is in the other direction
and doesn't apply, at least directly and obviously. In any case, I'll look
at these to see if I can gleen the info I need.

Thanks again, NWOP.
 
Yes, after looking at the articles they don't apply really. I've used
pinvoke a number of times previously and it just doesn't apply. I can't
"pinvoke" an entire application and then somehow design a managed control
into that application. I literally have a managed control that needs to be
put on an unmanaged form in an unmanaged application. I've seen some
references to doing this, but none of them are satisfactory and I'm looking
for a better way.

Thanks to any and all, NWOP.
 
Back
Top