简体   繁体   English

在Win32 C ++(非托管)应用程序中使用C ++ \\ C#.Net程序集\\ DLL

[英]Using C++\C# .Net assemblies\DLL's in win32 C++ (unmanaged) application

有什么方法可以在Win32 C ++(非托管)应用程序中使用C ++ \\ C#.Net程序集\\ DLL?

Is it possible to use .Net, from any language, in C++ in a 100% pure unmanaged application? 是否可以在100%纯非托管应用程序中以任何语言在C ++中使用.Net?

No it is not. 不它不是。 Using managed code requires the CLR to be in the process. 使用托管代码要求CLR处于过程中。

Is it possible to use .Net, from any language, in C++ in an unmanaged application that does not specifically start up the CLR? 是否可以在未专门启动CLR的非托管应用程序中以任何语言在C ++中使用.Net?

Yes. 是。 It is possible to use the managed code via COM Interop. 可以通过COM Interop使用托管代码。 In this case the native code need not know that the CLR is even in process. 在这种情况下,本机代码不需要知道CLR正在处理中。 It would create the COM objects as it would if they were defined in C++ and not know the difference. 它将创建COM对象,就像它们是用C ++定义并且不知道它们之间的区别一样。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM