I'm using Embedded Mono and P/Invoke DllImport. If I have a method which
returns a string
[DllImport("__Internal", EntryPoint = "CSharp_Test_ReturnString")]
public extern static string CSharp_Test_ReturnString();
The corresponding "C" method should strdup the string right?
extern "C"
{
char* CSharp_Test_ReturnString()
{
QString sv = "QString allocated";
return strdup((const char*)sv.toAscii());
}
}
Won't the CLR free that string for me?
--
View this message in context:
http://mono.1490590.n4.nabble.com/Embedded-Mono-using-DllImport-Internal-and-returning-string-tp4467177p4467177.html
Sent from the Mono - General mailing list archive at Nabble.com.
_______________________________________________
Mono-list maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list