You also need to use MemFree on the memory returned by mystring.ToCString() when you've finished with it.
Isn't that what Noel meant?So if I do:
Trustee.ptstrName = "Users".ToCString()
after I've used Trustee I should do:
MemFree(Trustee.ptstrName)
Is that correct? And I do that before I set Trustee to Null in order for the GC to deal with it right?
I don't have to do any more MemFree calls just because I've used String.FromCString(Trustee.ptstrName) do I?