Solved

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

Posted on 2000-03-05
2
260 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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 learn how to clear a vector as well as how to detect empty vectors in C++.

747 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

12 Experts available now in Live!

Get 1:1 Help Now