我有一个 Delphi DLL,它在由 delphi 应用程序调用时工作,并导出一个声明为的方法:
Procedure ProduceOutput(request,inputs:widestring; var ResultString:widestring);stdcall;
在 C++ 方面,我尝试过:
[DllImport( "ArgumentLab.dll", CallingConvention = CallingConvention.StdCall, CharSet=CharSet.WideString )];
extern void ProduceOutput(WideString request, WideString inputs, WideString ResultString);
WideString arequest = WideString(ComboBox1->Text);
WideString ainput = "<xml> Input Text Goes Here </XML>";
WideString aresultstring;
WideString &aresultstringpointer = aresultstring;
aresultstring = " ";
ProduceOutput(arequest, ainput, &aresultstringpointer);
Memo1->Lines->Text = aresultstring;
我的控制台错误显示:
Unit1.cpp(13): candidate function not viable: no known conversion from 'BSTR *' (aka 'wchar_t **') to 'System::WideString' for 3rd argument;
我已经使用 Rad Studio XE4 构建了 DLL 和 c++ 测试应用程序 - 它是一个 64 位 DLL 和 APP
我应该怎么做呢?
此致,
加里