views:

71

answers:

2

Can I have managed code within native code?

A: 

Not directly , but you can utilize COM callable wrapper to use Managed code within unmanaged code..

see this article :- http://www.codeproject.com/KB/atl/ComWarpperForDotNet.aspx

thatsalok
+1  A: 

There are quite a few ways to do this.

You can code in C++/CLI, the managed C++ compiler provided by Microsoft. You can mix managed and native code as you wish (security restrictions may apply).

You can go the COM route, and it's natively supported on the .NET side. Harder to program on the native side though, especially all the interop. You can start here: http://msdn.microsoft.com/en-us/magazine/cc163494.aspx.

The 3rd way is to "host" the .net runtime engine directly into your app and use it to load managed assemblies and then execute parts from them. This may be overkill for you, but it generates a 100% native image and doesn't rely on COM interop. You can start here: http://msdn.microsoft.com/en-us/library/dd380850.aspx.

Blindy