日期:2014-05-19  浏览次数:20933 次

c++调用c#简单方法
c++调用c#简单方法有哪些

------解决方案--------------------
com
------解决方案--------------------
最好封装成dll、ActiveX、Atl等再调用,帮顶
------解决方案--------------------
#using <mscorlib.dll>
#include <vcclr.h>
using namespace System;

class CppClass {
public:
gcroot <String*> str; // can use str as if it were String*
CppClass() {}
};

int main() {
CppClass c;
c.str = new String( "hello ");
Console::WriteLine( c.str ); // no cast required
}
Output


------解决方案--------------------
简单的可以直接调用哦

http://www.cppblog.com/mzty/archive/2007/03/02/19109.html