Hello everyone, I'm trying to do something simple here. When I execute the following code in Visual Studio 2008 using the unicode character set, xmlString is correct.
Unfortunately I need to convert the CString to a unsigned char*. Using the code below, ucStr becomes "<" (i.e. the first character of xmlString).
How should I convert the CString to an unsigned char* and retain all the information?
CString xmlString;
xmlString.Format( _T("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?><gateway><config-read><%s /></config-read></gateway>"), keyName);
unsigned char * ucStr = reinterpret_cast<unsigned char *> (xmlString.GetBuffer());
pgIRequest->SendXmlData( "dgv/gateway.xml", ucStr, xmlString.GetLength() + 1) ;