开发者

Using C++ code in C#

开发者 https://www.devze.com 2023-01-13 03:54 出处:网络
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#.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消