作了一个项目c#写的,实现了remoting和其他c#程序通信,但目前还需要和c++工程相互调用。请高手支招。

解决方案 »

  1.   

    用webservice或把程序改成符合clr规范的
      

  2.   

    最好封装成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 
      

  3.   

    封装成DLL 然后dll import调用不可以么?
      

  4.   

    最好封装为COM组件,C++调用就方便些,但是客户端还是需要装。NET框架
    C#的DLL只能是vc7,VB。NET,C#可以用,c++用不了如果用WEB SERVICE也可以,不过c++调用会比较麻烦,但不需要。NET框架
      

  5.   

    转换成COM吧,vc6就可以调用了