XML transcode - CString to XMLCh

E

eagle_speaks

I am posting this for reference so that some may find it usefull

---------------------------------------
XML transcode - XMLCh to char

void CADCXMLEventHandler::startElement(
const XMLCh* const uri,
const XMLCh* const localname_parameter,
const XMLCh* const qname,
const Attributes& attrs)
{

std::auto_ptr<char> localname
(XMLString::transcode(localname_parameter))

----------------------------------------
XML transcode - CString to XMLCh

CString csFilePath(_T("Test Path"));
char szDest[MAX_PATH+1];
WideCharToMultiByte( CP_ACP, 0, (LPCTSTR)csFilePath, -1,
szPathdest, MAX_PATH, NULL, NULL );

std::auto_ptr<XMLCh> xchFilePath (XMLString::transcode(szDest));

m_source =new LocalFileInputSource(xchFilePath .get());


----------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top