Bool WINAPI test (uchar * outData, char * outResult)
{
STD: : string strResult="XXXXX"
OutResult=(char *) CoTaskMemAlloc (strResult. The size () + 1);
StrResult. Copy (outResult strResult), size (), 0).
* (outResult + strResult. The size ())='\ 0';
}
In the c # how to call this function to get the string in the outResult, I tried IntPtr and StringBuilder are not, or whether the c + + functions need to be modified
CodePudding user response:
Ref intptrHave a look, not in the other ways to
Or post before, how to call depends on how to write c + +, rather than the light to see a function declaration, distributing the Pointers and memory are changed here
CodePudding user response:
https://blog.csdn.net/Koupoo/article/details/7844887Here is the corresponding instructions
CodePudding user response:
Upstairs truth!!!!!!CodePudding user response:
C + + function declarations with markExtern "C" bool WINAPI test (uchar * outData, char * outResult)