Click here to Skip to main content
12,504,560 members (55,447 online)

C / C++ / MFC

 
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 
To convert wide strings to char or multi-byte without loss of information, the wide string must only contain characters from a specific known character set / code page.

When using the wcstombs() conversion function, you must first set the locale to those used by the input string and restore it after conversion (see setlocale()[^]). The default locale is 'C' which is not language specific (English).

Another method is using WideCharToMultiByte()[^] where the code page can be specified:
int nCP = 1252; // Example: Windows-1252
// Get required buffer size
int nSize = ::WideCharToMultiByte(nCP, 0, str.GetString(), -1, NULL, 0, NULL, NULL);
char *nstringw = new char[nSize];
::WideCharToMultiByte(nCP, 0, str.GetString(), -1, nstringw, nSize, NULL, NULL);
If the code page of the input string is the same as for the current thread, you can use conversions provided by the CStringT class. This should do the job in most cases:
// Create a char/multi-byte string from wide string.
// Pass LPCSTR to constructor, so use casting or GetString()!
CStringA strA(str.GetString());
// Convert it back to a wide string
CStringW strW(strA.GetString());

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 
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 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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
Web02 | 2.8.160919.1 | Last Updated 26 Sep 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid