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.
我有一个 mfc dll,我喜欢将它加载到 C 语言程序中!
我的源教程:http: //blogs.msdn.com/b/jonathanswift/archive/2006/10/03/dynamically-calling-an-unmanaged-dll-from-.net-_2800_c_23002900_.aspx
问题是他在函数中使用原始数据类型(例如 int)来加载,但我需要自己的类型(getInstance() 的类对象)!
有没有简单的方法可以做到这一点?
谢谢,问候 leon22
您不能在 C# 项目中使用 C++ 类。事实上,您不能在使用不同编译器编译的任何项目中使用 C++ 类,例如不同版本的 MSVC。
您最好的方法是使用 COM,它是一种旨在解决此问题的二进制接口标准。