From: Derek on
Hi,
How to convert from CString to stl string?
I tried many things and doesn't work.
thanks


From: AliR on
CString Temp = "This is a test";

string Str = (LPCSTR)Temp;

AliR.

"Derek" <der(a)yahoo.com> wrote in message
news:egz$UubMGHA.3728(a)tk2msftngp13.phx.gbl...
> Hi,
> How to convert from CString to stl string?
> I tried many things and doesn't work.
> thanks
>
>


From: Asser on
that I tried, doesn't work.

"AliR" <AliR(a)online.nospam> wrote in message
news:jstIf.20753$_S7.12727(a)newssvr14.news.prodigy.com...
> CString Temp = "This is a test";
>
> string Str = (LPCSTR)Temp;
>
> AliR.
>
> "Derek" <der(a)yahoo.com> wrote in message
> news:egz$UubMGHA.3728(a)tk2msftngp13.phx.gbl...
>> Hi,
>> How to convert from CString to stl string?
>> I tried many things and doesn't work.
>> thanks
>>
>>
>
>


From: Ajay Kalra on
What exactly is the problem? All you are using is the operator LPCTSTR
of CString. Show the code that is not working.

-----------
Ajay Kalra
ajaykalra(a)yahoo.com

From: Tim Ward on
"Ajay Kalra" <ajaykalra(a)yahoo.com> wrote in message
news:1140017418.811732.197740(a)g14g2000cwa.googlegroups.com...
>
> What exactly is the problem? All you are using is the operator LPCTSTR
> of CString. Show the code that is not working.

Yes, I'd expect that to work better than the

> string Str = (LPCSTR)Temp;

in the original answer.

--
Tim Ward
Brett Ward Limited - www.brettward.co.uk