Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2000-03-05
2
Medium Priority
?
292 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 400 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.
Suggested Courses

927 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