I'd recommend avoiding the _T() macro when calling Xerces routines because, as Alberto points out, whether it generates the right kind of string depends on the _UNICODE macro. If you ever change how you compile, everything that uses _T() will be broken. You can future-proof your code by using L"my string" where XMLCh* is required, and just "my string" where char* is required.
-----Original Message----- From: Alberto Massari [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 04, 2006 7:41 AM To: [email protected] Subject: Re: Query on Unicode Support for XERCES-C Hi Deba, At 12.31 04/10/2006 +0530, Debashis Tripathy wrote: >Hi, > >I need to implement XERCES-C on a MFC project. I need to know the extent of >Unicode Support provided by XERECES. My question is, whenever I need to pass >a literal string (for eg: "my string") to one of the XRECES library methods, >can I pass a unicode string (eg _T("my string") or L"my string") instead? On Windows platforms, wherever you see XMLCh* you can use L"my string" or _T("my string") if you have defined the _UNICODE macro. >Also, wherever XERCES expects a parameter of type "const char*", is it OK to >pass a "const _TCHAR*" or "LPCTSTR" instead? In this case _T("my string")/LPCTSTR/TCHAR* can only be used if the _UNICODE macro is NOT defined. Hope this helps, Alberto
