|
-
May 19th, 1999, 06:57 AM
#1
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
-
May 19th, 1999, 07:03 AM
#2
Re: operator LPCTSTR
like this :
LPCTSTR lpTest = (LPCTSTR) MyCString;
It's a cast-operator.
-
May 19th, 1999, 11:00 AM
#3
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;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|