Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
已经有使用本机代码开发的项目。 现在在一个小模块中使用 C++-CLI 中的 SQLSMO,我使用了托管代码。
如何将托管代码与本机代码集成?
Stack Overflow 中已经有几个类似的线程。关键字是 P/Invoke 和 COM Interop,具体取决于您的本地组件的类型。以下是一些链接:
这是一个很笼统的问题。这方面有各种各样的资源,包括MSDN。回顾文献,然后回来提出更具体的问题。
如果您只需要从非托管应用程序中引用您的托管类,并且不介意在 C++/CLI 下重新编译它,您可以使用gcroot.
gcroot