简体   繁体   English

在原生 C++ 应用程序中使用 .NET 组件

[英]Use .NET Assemblies in Native C++ Applications

I followed the instruction http://msdn.microsoft.com/en-us/visualc/bb892742 about how to use .NET Assemblies in Native C++ Applications.我按照说明http://msdn.microsoft.com/en-us/visualc/bb892742关于如何在本机 C++ 应用程序中使用 .NET 程序集。 Now my question is: Suppose I want to create a C++ dll where I call a .NET assembly in a similar way.现在我的问题是:假设我想创建一个 C++ dll 我以类似的方式调用 .NET 程序集。 Should it be possible to use LoadLibrary of this dll in a C++ native app?是否可以在 C++ 本机应用程序中使用此 dll 的 LoadLibrary? Or should the C++ native app in this case also be linked with the /clr option?或者在这种情况下 C++ 本机应用程序是否也应该与 /clr 选项链接? The second question is: what is the penalty of using the /clr flag in a C++ native app?第二个问题是:在 C++ 本机应用程序中使用 /clr 标志的惩罚是什么? Performance, Compile-time, Run-time, ... ?性能、编译时、运行时……?

You can load cli c++ dll with LoadLibrary from non cli application (have done this from Delphi application).您可以使用 LoadLibrary 从非 cli 应用程序加载 cli c++ dll(已从 Delphi 应用程序完成此操作)。 As my cli dll is small, can not make any statements about penalties.由于我的cli dll 很小,不能对处罚做出任何陈述。

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

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