UTF8 字符串。 该数据在不同语言的接口中按如下方式解析。
输入参数
C++
void Function(... const std::wstring& x, ...);
void Function(... const std::vector<wstring>& x, ...);
C#
void Function(... string x, ...);
void Function(... System.Array x, ...);
COM
void Function(... BSTR x, ...);
void Function(... SAFEARRAY* x, ...);
输出参数
C++
void Function(... std::wstring& x, ...);
void Function(... std::vector<wstring>& x, ...);
C#
void Function(... out string x, ...);
void Function(... out System.Array x, ...);
COM
void Function(... BSTR* x, ...);
void Function(... SAFEARRAY** x, ...);
返回值
C++
std::wstring Function(...);
std::vector<std::wstring> Function(...);
C#
string Function(...);
System.Array Function(...);
COM
BSTR Function(...);
SAFEARRAY* Function(...);
示例代码
C++
img1->Load(L"path_to_img_file1");
std::wstring path = L"path_to_img_file2";
img2->Load(path);
std::wstring ocrString = ocrResult->String;
std::vector<std::wstring> strlist = ibData->ToStringList();
C#
img1.Load("path_to_img_file1");
string path = "path_to_img_file2";
img2.Load(path);
string ocrString = ocrResult.String;
Array strlist = ibData.ToStringList();
string[] strs = strlist.OfType<string>().ToArray();
COM
img1->Load(L"path_to_img_file1");
CString path = L"path_to_img_file2";
img2->Load(path.GetString());
CString ocrString = ocrResult->String;
SAFEARRAY* strArr = ibData->ToStringList();
CComSafeArray<BSTR> strlist;
if (strlist) strlist.Attach(strArr);