[Mono-list] VC++.NET

Marsh, Drew dmarsh@mimeo.com
Mon, 6 May 2002 14:14:35 -0400


Thomas and Megan Packer [mailto:ThomasAndMegan@Middle.Net] wrote:

>     Will you have the ability in the future (or do you now)
> of imbedding C or C++ code in a C# application?  I'm going to 
> write an application in C#, but I'm fearing that I might need 
> a little more speed in some places than C# will provide.  I 
> am considering to put those parts into a C .DLL.  (I think 
> they are called .SO's in Linux.)  Will this be possible?  
> What would you suggest doing?

Anything you really need to get up against the metal for you can write in
vanilla C++ and interop with using P/Invoke (platform invoke). See the
section titled "Consuming Unmanaged DLL Functions"[1] in the Microsoft .NET
SDK for more details on interop'ing with native libraries.

A word of advice though: depending on what kind of work you're doing, make
sure to do some perf tests before just making the assumption that the
performance will not be acceptable.

HTH,
Drew

[1]
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconconsumingunmanageddllfunctions.asp