Re: String Manipulations
- From: "Mark" <mark_ivey4@xxxxxxxxx>
- Date: Tue, 22 Nov 2005 15:32:57 -0500
Thanks much Igor,
I would tend to agree with you based on the fact that the information you've
provided in just a few short replies being far more enlightening than the
sample code I acquired from this link:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_cstring.3a3a.operator_lpctstr.asp
I am good on this now and Hope to chat again soon!
Mark
"Igor Tandetnik" <itandetnik@xxxxxxxx> wrote in message
news:OFy7S857FHA.3660@xxxxxxxxxxxxxxxxxxxxxxx
> Mark <mark_ivey4@xxxxxxxxx> wrote:
>> I get it. But I didn't explicitly designate my program to run under
>> Unicode although after taking your advice it worked as I originally
>> expected. I am using VC++ 2005, where would the program be designated
>> to run under Unicode?
>
> I don't have VC2005 handy to check. In VC2003, that would be Project
> Properties | General | Character Set = Use Unicode. I expect VC2005 to be
> the same or very close.
>
>> I also noted that there is another procedure I acquired from MS
>> within the same scope of the CString example that wont compile either.
>>
>> sprintf(sz, "I think that %s!\n", (LPCTSTR) strSports);
>>
>> The compiler doesn't like this and produces an error:
>>
>> error C2664: 'sprintf' : cannot convert parameter 1 from 'TCHAR
>> [1024]' to 'char *'
>
> Make it
>
> _stprintf(sz, _T("I think that %s!\n"), (LPCTSTR) strSports);
>
> That should compile in both Unicode and Ansi builds. _stprintf is a macro
> expanding to swprintf or sprintf correspondingly.
>
>> Perhaps my project environment needs to be adjusted a bit? Running
>> sample code shouldn't be this cumbersome.
>
> Where are you getting this sample code? It does not seem to be
> particularly well designed, to put it mildly.
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
>
>
.
- Follow-Ups:
- Re: String Manipulations
- From: David Webber
- Re: String Manipulations
- References:
- String Manipulations
- From: Mark
- Re: String Manipulations
- From: Igor Tandetnik
- Re: String Manipulations
- From: Mark
- Re: String Manipulations
- From: Igor Tandetnik
- String Manipulations
- Prev by Date: Re: Question on Crypto API
- Next by Date: inserting item into list view
- Previous by thread: Re: String Manipulations
- Next by thread: Re: String Manipulations
- Index(es):
Relevant Pages
|