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

发布于 2024-08-21 11:43:06 字数 56 浏览 5 评论 0原文

有没有办法在 win32 C++(非托管)应用程序中使用 C++\C# .Net 程序集\DLL?

There is any way to use C++\C# .Net assemblies\DLL's in win32 C++ (unmanaged) applications?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

秉烛思 2024-08-28 11:43:06

是否可以在 100% 纯非托管应用程序中以 C++ 形式使用任何语言的 .Net?

不,不是。使用托管代码需要 CLR 位于进程中。

是否可以在不专门启动 CLR 的非托管应用程序中使用任何语言的 C++ 中的 .Net?

是的。可以通过 COM Interop 使用托管代码。在这种情况下,本机代码甚至不需要知道 CLR 是否正在处理。它会像在 C++ 中定义 COM 对象一样创建 COM 对象,并且不知道其中的区别。

Is it possible to use .Net, from any language, in C++ in a 100% pure unmanaged application?

No it is not. Using managed code requires the CLR to be in the process.

Is it possible to use .Net, from any language, in C++ in an unmanaged application that does not specifically start up the CLR?

Yes. It is possible to use the managed code via COM Interop. In this case the native code need not know that the CLR is even in process. It would create the COM objects as it would if they were defined in C++ and not know the difference.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文