Click here to Skip to main content
11,584,208 members (37,541 online)

C / C++ / MFC

 
GeneralRe: Changing Dialog Button Color at runTime Pin
manoranjan21-Nov-12 19:40
membermanoranjan21-Nov-12 19:40 
QuestionPng Image button problem. Pin
yu-jian20-Nov-12 6:53
groupyu-jian20-Nov-12 6:53 
QuestionMinimize CDialog Problem Pin
yu-jian20-Nov-12 6:22
groupyu-jian20-Nov-12 6:22 
AnswerRe: Minimize CDialog Problem Pin
jeron120-Nov-12 6:31
memberjeron120-Nov-12 6:31 
QuestionRe: Minimize CDialog Problem Pin
Maximilien20-Nov-12 8:26
memberMaximilien20-Nov-12 8:26 
QuestionCheck if a character is lowercase and change to uppercase. Pin
MitchG92_2420-Nov-12 0:49
memberMitchG92_2420-Nov-12 0:49 
AnswerRe: Check if a character is lowercase and change to uppercase. Pin
MitchG92_2420-Nov-12 0:56
memberMitchG92_2420-Nov-12 0:56 
AnswerRe: Check if a character is lowercase and change to uppercase. Pin
sajeesh.c20-Nov-12 17:34
membersajeesh.c20-Nov-12 17:34 
GeneralRe: Check if a character is lowercase and change to uppercase. Pin
Richard MacCutchan20-Nov-12 21:31
mvpRichard MacCutchan20-Nov-12 21:31 
QuestionIs it possible to capture an HD video/ to generate videos in HD in C++/VC++/MFC.? Pin
mbatra3119-Nov-12 22:15
membermbatra3119-Nov-12 22:15 
QuestionProblem with string conversion Pin
HungryCPPDev19-Nov-12 19:08
memberHungryCPPDev19-Nov-12 19:08 
AnswerRe: Problem with string conversion Pin
Jochen Arndt19-Nov-12 21:40
memberJochen Arndt19-Nov-12 21:40 
GeneralRe: Problem with string conversion Pin
HungryCPPDev20-Nov-12 18:05
memberHungryCPPDev20-Nov-12 18:05 
GeneralRe: Problem with string conversion Pin
Jochen Arndt22-Nov-12 2:52
memberJochen Arndt22-Nov-12 2:52 
Sorry for my late answer. I overlooked your reply.

The CStringT class constructors and assignment operators accepting the LPCSTR and LPCWSTR types will convert the string if it does not match (when assigning LPCWSTR to a CStringA object it is converted to ANSI and when assigning LPCSTR to a CStringW object it is converted to Unicode). The conversion is internally performed using WideCharToMultiByte() and MultiByteToWideChar() with code page CP_THREAD_ACP (when using Visual Studio 2003 and later; with older versions or manually set preprocessor definition _CONVERSION_DONT_USE_THREAD_LOCALE, CP_ACP is used). See the ATL/MFC source files cstringt.h and atlconv.h if you are interested in how the conversions are performed.

If you are not calling SetThreadLocale() within your app, the thread will use the system locale.

If the results from using WideCharToMultiByte() and CStringT constructors are different, you have passed a code page number that differs from the default code page of the used locale.

So you may post your settings here or check it yourself:
  • The code page passed to WideCharToMultiByte()
  • The code page used by the CStringT class
To get the code page used by the CStringT class use this code snippet (assuming CP_THREAD_ACP is used):
// Default ANSI code page
int nCP = ::GetACP();
// Returns same as GetSystemDefaultLCID() when SetThreadLocale() has not been called.
LCID nLCID = ::GetThreadLocale();
TCHAR szACP[7];
if (::GetLocaleInfo(nLCID, LOCALE_IDEFAULTANSICODEPAGE, szACP, 7) != 0)
    nCP = _tstoi(szACP);
Now compare nCP with the value passed to WideCharToMultiByte().

All these different locales and code pages may be confusing. So I will sum up the settings that may effect your conversions:
  • The system locale including its default ANSI code page
  • The user's locale including its default ANSI code page
  • The thread's locale including its default ANSI code page
  • The code page used by the CStringT class
  • The code page passed to conversion functions in your code

QuestionHow to set the alignment of items of CListCtrl Pin
rahul.kulshreshtha19-Nov-12 16:43
memberrahul.kulshreshtha19-Nov-12 16:43 
AnswerRe: How to set the alignment of items of CListCtrl Pin
Richard MacCutchan19-Nov-12 22:50
mvpRichard MacCutchan19-Nov-12 22:50 
GeneralRe: How to set the alignment of items of CListCtrl Pin
rahul.kulshreshtha19-Nov-12 23:22
memberrahul.kulshreshtha19-Nov-12 23:22 
GeneralRe: How to set the alignment of items of CListCtrl Pin
Richard MacCutchan20-Nov-12 0:02
mvpRichard MacCutchan20-Nov-12 0:02 
GeneralRe: How to set the alignment of items of CListCtrl Pin
rahul.kulshreshtha20-Nov-12 16:30
memberrahul.kulshreshtha20-Nov-12 16:30 
GeneralRe: How to set the alignment of items of CListCtrl Pin
Richard MacCutchan20-Nov-12 21:17
mvpRichard MacCutchan20-Nov-12 21:17 
QuestionLinked Lists and unique_ptr's Pin
Tom Moore19-Nov-12 7:29
memberTom Moore19-Nov-12 7:29 
AnswerRe: Linked Lists and unique_ptr's Pin
Eugen Podsypalnikov19-Nov-12 10:50
memberEugen Podsypalnikov19-Nov-12 10:50 
AnswerRe: Linked Lists and unique_ptr's Pin
Chris Meech19-Nov-12 14:04
memberChris Meech19-Nov-12 14:04 
Questionencrypt and decrypt Pin
thandy mitchell19-Nov-12 6:24
memberthandy mitchell19-Nov-12 6:24 
AnswerRe: encrypt and decrypt Pin
Richard MacCutchan19-Nov-12 7:59
mvpRichard MacCutchan19-Nov-12 7:59 
AnswerRe: encrypt and decrypt Pin
CPallini19-Nov-12 11:36
mvpCPallini19-Nov-12 11:36 
Questionaccess excel data using c++ Pin
lakshmamma19-Nov-12 2:05
memberlakshmamma19-Nov-12 2:05 
AnswerRe: access excel data using c++ Pin
Flaviu219-Nov-12 2:14
memberFlaviu219-Nov-12 2:14 
AnswerRe: access excel data using c++ Pin
CPallini19-Nov-12 2:17
mvpCPallini19-Nov-12 2:17 
AnswerRe: access excel data using c++ Pin
Jochen Arndt19-Nov-12 2:26
memberJochen Arndt19-Nov-12 2:26 
QuestionScroll window after zoom Pin
Flaviu218-Nov-12 22:11
memberFlaviu218-Nov-12 22:11 
AnswerMessage Removed Pin
Flaviu218-Nov-12 22:18
memberFlaviu218-Nov-12 22:18 
QuestionPre commit hooks for svn Pin
Mukul_P18-Nov-12 17:41
memberMukul_P18-Nov-12 17:41 
AnswerRe: Pre commit hooks for svn Pin
Richard MacCutchan18-Nov-12 21:42
mvpRichard MacCutchan18-Nov-12 21:42 
AnswerRe: Pre commit hooks for svn Pin
April Fans22-Dec-12 21:07
memberApril Fans22-Dec-12 21:07 
QuestionC++, RealTime Scheduler in Operating System Pin
Kevin Stlip17-Nov-12 16:10
memberKevin Stlip17-Nov-12 16:10 
AnswerRe: C++, RealTime Scheduler in Operating System Pin
Richard MacCutchan17-Nov-12 21:46
mvpRichard MacCutchan17-Nov-12 21:46 
Questionporting my device driver 32 bit to windows 7 64 bit Pin
navn199116-Nov-12 22:03
membernavn199116-Nov-12 22:03 
AnswerRe: porting my device driver 32 bit to windows 7 64 bit Pin
jschell17-Nov-12 5:52
memberjschell17-Nov-12 5:52 
GeneralRe: porting my device driver 32 bit to windows 7 64 bit Pin
BilliousBob23-Nov-12 4:50
memberBilliousBob23-Nov-12 4:50 
AnswerRe: porting my device driver 32 bit to windows 7 64 bit Pin
Clark Kent SuperCoder17-Nov-12 5:52
memberClark Kent SuperCoder17-Nov-12 5:52 
GeneralRe: porting my device driver 32 bit to windows 7 64 bit Pin
navn199118-Nov-12 21:54
membernavn199118-Nov-12 21:54 
GeneralRe: porting my device driver 32 bit to windows 7 64 bit Pin
Clark Kent SuperCoder19-Nov-12 0:15
memberClark Kent SuperCoder19-Nov-12 0:15 
GeneralRe: porting my device driver 32 bit to windows 7 64 bit Pin
navn199121-Nov-12 2:40
membernavn199121-Nov-12 2:40 
GeneralRe: porting my device driver 32 bit to windows 7 64 bit Pin
BilliousBob23-Nov-12 4:51
memberBilliousBob23-Nov-12 4:51 
AnswerRe: porting my device driver 32 bit to windows 7 64 bit Pin
BilliousBob23-Nov-12 4:50
memberBilliousBob23-Nov-12 4:50 
QuestionMemory usage Pin
john563215-Nov-12 21:48
memberjohn563215-Nov-12 21:48 
AnswerRe: Memory usage Pin
Orjan Westin15-Nov-12 23:23
memberOrjan Westin15-Nov-12 23:23 
AnswerRe: Memory usage Pin
DavidCrow16-Nov-12 2:27
memberDavidCrow16-Nov-12 2:27 
AnswerRe: Memory usage Pin
Rolf Kristensen16-Nov-12 3:30
memberRolf Kristensen16-Nov-12 3:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 7 Jul 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid