Solved

Localization : Is CString::Left() function safe?

Posted on 2000-03-05
2
264 Views
Last Modified: 2007-12-19
If I am writing a UNICODE app, is it safe to use the CString Left() function (i.e. CString s = x.Left(5) where x is also a CString with a value in it?

Or do I need to do something like: s = x.Left(5 * sizeof(TCHAR))

Thanks.
0
Comment
Question by:rascal
2 Comments
 
LVL 3

Accepted Solution

by:
mnewton022700 earned 100 total points
ID: 2586371
It is definitely safe. I've worked with CString under UNICODE for quite some time and have never had any problems.

Left extracts the given number of characters whether they be TCHARs or simply chars.

0
 

Expert Comment

by:Pyr0
ID: 8018799
I used the Left function and it did not extract anything... it returned the entire word!! ?????
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now