As I understood, when returning System.String with interop, .NET tries
to delete it with CoTaskMemFree(). But, this char* points to permanent
part of memory, and should not be deleted. Is it possible to disable
this behaviour (with some marshal attribute maybe)? I know I can return
IntPtr, but I want cleaner solution if possible ;)
Mattias Sj?gren - 27 Dec 2004 23:30 GMT
>Is it possible to disable
>this behaviour (with some marshal attribute maybe)?
No, changing the return type to IntPtr is the way to do it.
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.