C#调用C++的dll,返回空字符串,求助
C++的Dll
extern "C" __declspec(dllexport)
bool __cdecl GetResult(int value1,unsigned char * value2)
{
if (value1)
FuncA(value2);
else
FuncB(value2);
return true;
}
void FuncA(unsinged char* value)
{
....
}
void FuncB(unsigned char* value)
{
...
}
C#里调用
string strValue;
int iCount;
GetResult(iCount,ref strValue);//不用ref也是返回空值
得到的strValue为空值,请问,Dll里应该怎样定义传入的参数,才能返回字符串给C#?