CString to const char*
- From: "NickP" <a@xxxxx>
- Date: Wed, 27 Sep 2006 13:02:24 +0100
Hi there,
I am having some really strange issues with the CString class...
For some reason it will not convert to const char* automatically, if I
try manually I just end up with a screwed up ASCII string still containing 0
bytes from the UNICODE equivilent.
char *pBuffer = new char[iString.GetLength()];
pBuffer = (char*)iString.GetBuffer(sizeof(pBuffer));
MessageBoxA(NULL, pBuffer, "", 0);
Strange thing is my CString class is within the WTL namespace, is there
more than one implementation of CString available?
What would be the best object to use for string handling, I thought this
class was okay but have read sources on the net that say std::string is
better...
Preferably I'd like to just use CString and convert it nicely... Thanks
loads in advance!
My application is UNICODE enabled. Thanks loads in advance.
Nick.
.
- Follow-Ups:
- Re: CString to const char*
- From: Abdo Haji-Ali
- Re: CString to const char*
- From: Ulrich Eckhardt
- Re: CString to const char*
- From: Victor Bazarov
- Re: CString to const char*
- Prev by Date: Re: Why Win64 (x86_64) executable has more footprint than Win32?
- Next by Date: Re: please help vb6.0 code
- Previous by thread: please help vb6.0 code
- Next by thread: Re: CString to const char*
- Index(es):
Relevant Pages
|