CString and BSTR in WinCE
-
When assigning a CString to a BSTR, does CString contain a copy of the BSTR or is it a pointer to the same BSTR? If I later destroy the original BSTR does this make the CString unusable? Example: CString strAnotherCopy; BSTR b; b = SysAllocStringByteLen("Hello World", 12); strAnotherCopy = b; SysFreeString(b); At this point, is strAnotherCopy still valid?
-
When assigning a CString to a BSTR, does CString contain a copy of the BSTR or is it a pointer to the same BSTR? If I later destroy the original BSTR does this make the CString unusable? Example: CString strAnotherCopy; BSTR b; b = SysAllocStringByteLen("Hello World", 12); strAnotherCopy = b; SysFreeString(b); At this point, is strAnotherCopy still valid?
Yes, CString contains a copy of the BSTR, but not stored as a BSTR.