Converting from XMLCh* (or DomString) to BSTR:
Use XMLString::Transcode (or DomString::Transcode) to convert to a char*, then use SysAllocString() to convert to BSTR.
When converting from BSTR to DomString, the simplest approach is to use the
DOMString (const XMLCh *other,unsigned int length) constructor, casting your BSTR to an XMLCh, and using SysStringLen() to provide the length information. A better method is to convert the BSTR to ANSI using WideCharToMultiByte(), then use the relevant Transcode to convert into DomString or XMLCh*.
Remember to delete any dynamically created objects!
-----Original Message-----
From: Bavishi, Pankij [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 12, 2002 14:51
To: [EMAIL PROTECTED]
Subject: RE: BSTR
Hello Ellis,
Thanks a lot for a detailed explanation.
Yeah it is very helpful.
But right now on practical grounds, I need to know how I can convert the
BSTR data into something that Xerces-C++ can understand.
Right now I am only aware of something like DOMString.
Do you have any suggestions like using transcode() etc..
If yes could you please detail it out.
Thank you so much
pankaj
