Click here to Skip to main content
       

C / C++ / MFC

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page  Show 
AnswerRe: Minimize CDialog Problemmemberjeron120 Nov '12 - 6:31 
My guess is that login being a modal dialog will prevent the parent window from processing things (like paint messages) until the modal dialog is dismissed. Might you use a modeless dialog in this case?
QuestionRe: Minimize CDialog ProblemmemberMaximilien20 Nov '12 - 8:26 
Why, oh, Why do you want to minimize the main frame window when the Modal login dialog is displayed ?
 
Don't make it hard on you, just keep the main frame as is.
Nihil obstat

QuestionCheck if a character is lowercase and change to uppercase.memberMitchG92_2420 Nov '12 - 0:49 
Hi all,
 
I'm abit of a newbie to C so what i am askign may be simple but i can't seem to find much on the internet.
 
i have:
char name[15];
Which could for example, contain the name "james". What can i use to check if the first character (in this case "j") is lowercase and if it is, change it to uppercase.
 
Many Thanks!
AnswerRe: Check if a character is lowercase and change to uppercase.memberMitchG92_2420 Nov '12 - 0:56 
Sorry just found it myself, literally just after i posted this.
 
name[0] = toupper(name[0]);

AnswerRe: Check if a character is lowercase and change to uppercase.membersajeesh.c20 Nov '12 - 17:34 
In c language you can check wether the language is in lower case or upper case by using their ASCII value.
ie, for "A" ASCII value is 65. for "a" ASCII is 97. by directly checking this condition you can ensure character is small letter or capital letter.
to convert you can use
toupper
or
tolower
.
GeneralRe: Check if a character is lowercase and change to uppercase.mvpRichard MacCutchan20 Nov '12 - 21:31 
What happens if the letter is "b" or ... The standard way of checking is to use isupper()[^].
One of these days I'm going to think of a really clever signature.

QuestionIs it possible to capture an HD video/ to generate videos in HD in C++/VC++/MFC.?membermbatra3119 Nov '12 - 22:15 
Hi,
 
I am working on a project in which we can capture a video, save it in avi format. We are using Microsoft Directx for the same.
Now I want to increase the quality of the video similar to the HD mode. Is It possible using C++/VC++/MFC.?
Is it possible that we can capture a video with high quality or after capturing/saving the video, play the same in HD mode.?
 
Please let me know if the above discussion is ambiguous.
 
Anybody have any idea regarding the same.?
 
Any help would be appreciated.
 
Thanx in Advance.
 
Regards,
Mbatra
QuestionProblem with string conversionmemberHungryCPPDev19 Nov '12 - 19:08 
Hi All,
I am using below code to convert CString to char* and again back to CString. I am using 3rd party code which takes char* only.
 
const size_t newsizew = (str.GetLength()+1)*2;
char *nstringw = new char[newsizew];
size_t convertedCharsw = 0;
wcstombs_s(&convertedCharsw, nstringw, newsizew, str.GetBuffer(), newsizew /*_TRUNCATE*/ );
AfxMessageBox(CString(CA2T(nstringw)));
 
The conversion is working fine when content of str is in english. But this is not working properly when str is in other language.
Can anyone suggest me how to make it work even for other languages.
 
Thanks in advance.
AnswerRe: Problem with string conversionmemberJochen 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 [modified]memberHungryCPPDev20 Nov '12 - 18:05 
Thanks for your reply. I am able to convert successfully using WideCharToMultiByte function. But I am facing the same problem when I use CStringA strA(str.GetStrng()) for conversion, even when I use SetLocale() function. Can you please help me out in this.

modified 21 Nov '12 - 5:49.

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


Advertise | Privacy | Mobile
Web04 | 2.6.130523.1 | Last Updated 23 May 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid