如何写??谢谢各位了

解决方案 »

  1.   

    用_cdcel调用规范,字符串类型用BSTR吧
      

  2.   

    extern "C" BSTR  _stdcall  GetPath()
    {
         GetCurPath();
     CString strPath="";
     strPath="abcd";
     return SysAllocString((BSTR)strPath.GetBuffer(0));   
    }调用时在VB中会得到函数,但在相应的字符串后面有一堆乱码??
      

  3.   

    extern __declspec(dllexport) BSTR PASCAL MyFunc(LPSTR lpStr1, LPSTR lpStr2)
    {
    AfxMessageBox((CString)lpStr1  +  "     dlllll     " + (CString)lpStr2 );
         char *str="你需要返回的字符串"; 
         return SysAllocString((BSTR)str); }