I would extract the data from the CString using the GetBuffer() function, then create a BSTR using the _bstr_t wrapper class like in this pseudo-code example:
function convert (CString input)
{
char temp[80];
temp = input.GetBuffer();
_bstr_t temp2((const char*)temp);
BSTR final = (BSTR)temp2;
}
Hope that helps! [sig]<p>Pat Gleason<br><a href=mailto:gleason@megsinet.net>gleason@megsinet.net</a><br><a href= > </a><br> [/sig]
MSDN says that you can use CString::AllocSysString() to allocate a BSTR from CString data, and you can also use CString::SetSysString() to set an existing BSTR object with data from a CString object.
Much better! [sig]<p>Pat Gleason<br><a href=mailto:gleason@megsinet.net>gleason@megsinet.net</a><br><a href= > </a><br> [/sig]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.