开发者

Interoperation and CRL Activity

开发者 https://www.devze.com 2023-03-16 06:36 出处:网络
I hope that question would not mess with StackOverFlow FAQ rules So ,when using Libraries which are written in C++ for example ,and that means we have some Code in these DLL\'s which is going to be e

I hope that question would not mess with StackOverFlow FAQ rules

So ,when using Libraries which are written in C++ for example ,and that means we have some Code in these DLL's which is going to be executed ,when Software execution cames in that case ,will this Portion of code be execu开发者_开发百科ted by CLR ?

I need that because we plan to develop a Software and some Angry Algorithms i think will be better to program them in C++ ,but Visual C# serves us some tools that we cant find in c++ (Linq ,Anonymous etc) .


You can use DLLs created in C++ inside your C# project, and as you already know you have to make an interop call. This switches context to unsafe, so the code is probably executed outside the CLR. This means that you lose the portability options the CLR gives you. For example a C# based app would run on Windows and Windows Phone, but adding interop calls will only make it work on Windows (or whatever system the DLL was compiled for).

But normally this isn't much of an issue.

Also see this thread: http://forums.devshed.com/net-development-87/using-a-c-dll-in-c-107829.html

0

精彩评论

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