Another VC++ thought...if you are using MFC you can very easily get a BSTR from a CString by calling CString::AllocSysString().  If CString is already UNICODE there is no code page conversion to get to the  BSTR. In addition, I think the Win32 API function SysAllocString() does the same thing.  Something like this should work...
 
BSTR bstr = CString( domString.rawBuffer() ).SysAllocString();
 
-dh
 
----- Original Message -----
Sent: Thursday, February 07, 2002 11:59 AM
Subject: RE: BSTR

No - you have to translate one to the other using transcode to get the transcoded characters from a DOM string and create a BSTR from that.  BSTRs have to reside in a special memory heap.  Depending in your environment you might like ATL' s CComBSTR class to accept and managed the characters from transcode. 
 
DOMString domString("foo");
CComBSTR bstrString(domString.transcode())
 
Jim
-----Original Message-----  
From: Bavishi, Pankij [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 11:20 AM
To: [EMAIL PROTECTED]
Subject: BSTR

 

Thanks guys for my former query.

Just want to confirm one more thing:

Is BSTR compatible with DOMString? Can I replace BSTR with DOMString if I am working on VC++?

 

Reply via email to