Using C++ code in C#
I had written a code snippet in VC++. However, I cannot continue rest of the application in VC++, so would want to 开发者_开发知识库move to C#.
Can I make a dll of the VC++ code and call the functions written in VC++ to work in C#?
I'm quite un-aware if this will work, but I have seen how the native code is called in C# using dll.
Can anyone please help me on this.
Thanks.
You could try compiling your C++ code as managed code using the /clr
option and then use it directly or use P/Invoke
to call the unmanaged functions from managed code.
精彩评论