You question says how to convert to char *, but the error is the
conversion to wchar_t *. They are quite different.
A PString is always UTF-8 (8 bits per character) and wchar_t is
16 bits (possibly more) per character. A CString in MFC is sometimes 8 bit
sometimes 16 bit (UNICODE) depending on compiler options. Which makes coding
tricky.
So, if your code is guaranteed to always be using UNICODE
CString just go other.AsUCS2() in your == operator. You can also look at the
class PWideString for more.
Robert Jongbloed
OPAL/OpenH323/PTLib Architect and Co-founder.
From: h323plus-bounces@lists.packetizer.com
[mailto:h323plus-bounces@lists.packetizer.com] On Behalf Of ZAHRA
dehghanianfard
Sent: Thursday, 29 October 2009 9:00 PM
To: h323plus
Subject: [h323plus] please help us to convert PString object content to
char * in VC++.
hi sir/modem |
New
Email addresses available on Yahoo!
Get the Email name you've always wanted on the new @ymail and @rocketmail.
Hurry before someone else does!