Marcus de Leon
2009-10-06 12:18:42 UTC
Hi,
Here is my situation. I have a BSTR* bsNameVar that is allocated
using ::SysAllocString(), then bsNameVar gets assigned to a member
variable CString mcsNameVar. The problem is, when I use ::SysFreeString
(*bsNameVar), mcsNameVar also loses it's memory allocation. I thought
that is used a separate memory space, but I guess not. How can I free
the memory of for mcsNameVar on destruction if I don't release the
memory on bsNameVar?
Thanks,
Marcus
Here is my situation. I have a BSTR* bsNameVar that is allocated
using ::SysAllocString(), then bsNameVar gets assigned to a member
variable CString mcsNameVar. The problem is, when I use ::SysFreeString
(*bsNameVar), mcsNameVar also loses it's memory allocation. I thought
that is used a separate memory space, but I guess not. How can I free
the memory of for mcsNameVar on destruction if I don't release the
memory on bsNameVar?
Thanks,
Marcus