R
roben
I want to call a function in C++ (external dll) from C#.
However the string is still empty after returning from the function.
-------------------
C#
-------------------
[DllImport("ccw.dll", CharSet=CharSet.Auto)] public static extern int
HelloWorld(StringBuilder abc);
StringBuilder mytext= new StringBuilder(1000);
AuthResult = HelloWorld(mytext);
//Here the string is still empty
-------------------
C++
-------------------
int HelloWorld(char *mytext)
{
mytext = "Hi..Test";
return 0;
}
Hope you can help!
Any suggestions?
However the string is still empty after returning from the function.
-------------------
C#
-------------------
[DllImport("ccw.dll", CharSet=CharSet.Auto)] public static extern int
HelloWorld(StringBuilder abc);
StringBuilder mytext= new StringBuilder(1000);
AuthResult = HelloWorld(mytext);
//Here the string is still empty
-------------------
C++
-------------------
int HelloWorld(char *mytext)
{
mytext = "Hi..Test";
return 0;
}
Hope you can help!
Any suggestions?