-
operator LPCTSTR
Hi!
How do I have to use this string operator?
I have a CString object i.e. "s" and now I want to access the characters stored in this object.
I do not want to use the member function "GetBuffer( )".
Thanx in advance...
Normen
--
apartis AG http://www.apartis.de
Normen Mueller
-
Re: operator LPCTSTR
like this :
LPCTSTR lpTest = (LPCTSTR) MyCString;
It's a cast-operator.
-
Re: operator LPCTSTR
If you feel more comfortable with C style of accessing strings, cast it to char type first.
E.g.
CString s="My String";
char *cpBuffer;
cpBuffer=new char[s.GetLength()+1];
strcpy(cpBuffer, (LPCTSTR)s);
... // do character by character access
delete []cpBuffer;