Click here to Skip to main content
15,886,787 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ListView_InsertColumn associated subitem Pin
NoviceEx18-Oct-12 3:07
NoviceEx18-Oct-12 3:07 
GeneralRe: ListView_InsertColumn associated subitem Pin
Richard MacCutchan18-Oct-12 3:26
mveRichard MacCutchan18-Oct-12 3:26 
AnswerRe: ListView_InsertColumn associated subitem Pin
Jochen Arndt18-Oct-12 3:42
professionalJochen Arndt18-Oct-12 3:42 
GeneralRe: ListView_InsertColumn associated subitem Pin
Richard MacCutchan18-Oct-12 4:39
mveRichard MacCutchan18-Oct-12 4:39 
QuestionHow to copy map reference Pin
NoviceEx17-Oct-12 22:33
NoviceEx17-Oct-12 22:33 
AnswerRe: How to copy map reference Pin
Richard MacCutchan17-Oct-12 22:58
mveRichard MacCutchan17-Oct-12 22:58 
AnswerRe: How to copy map reference Pin
Stephen Hewitt18-Oct-12 6:30
Stephen Hewitt18-Oct-12 6:30 
QuestionKey capture using OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) method Pin
Member 935377616-Oct-12 23:00
Member 935377616-Oct-12 23:00 
See more: VC++
Dear All,

I am working MFC Application, this application is compiled using VS2008.
To capture the key pressed
OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
method is used.

The strange thing happening is when i press the key "a" without caps lock its gives the nChar value as "65" which is suppose to be "97".

Even if the caps lock is "ON" the value i get is "65" when i press "A".

The thing is either the caps lock is on or off, i get the same value as if the caps lock is on. (this is the case with all the keys)

as the OnKeyUp() is as MFC method, I am not sure how to solve this issue.

Kindly help me and let me know if you require any more information.


Below is the code i am using, because of this what happens is, when i set a text using SetDlgItemText(), it is always going as Upper case letter or word.

void CMyProg::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
{
CString SBCommand;
CString Temp;
char *s = NULL;
char strnChar[10];

/* Alphabets and Numerals passed to the command box */
if((nChar >= 65 && nChar <= 90) || (nChar >= 48 && nChar <= 57))
{
pFrame->m_wndStatusBar.GetDlgItemText(IDC_SB_POINT,SBCommand);
Temp.Format("%c",nChar);
SBCommand += Temp;
pFrame->m_wndStatusBar.SetDlgItemText(IDC_SB_POINT,SBCommand);


/*pFrame->m_wndStatusBar.GetDlgItemText(IDC_SB_POINT,SBCommand);
SBCommand += (char*)nChar;
pFrame->m_wndStatusBar.SetDlgItemText(IDC_SB_POINT,SBCommand);*/
}
}
AnswerRe: Key capture using OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) method Pin
Sivaraman Dhamodharan16-Oct-12 23:07
Sivaraman Dhamodharan16-Oct-12 23:07 
AnswerRe: Key capture using OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) method Pin
Jochen Arndt16-Oct-12 23:49
professionalJochen Arndt16-Oct-12 23:49 
AnswerRe: Key capture using OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) method Pin
«_Superman_»17-Oct-12 19:16
professional«_Superman_»17-Oct-12 19:16 
QuestionCStatusbar and Menubar Background color change Pin
shiv@nand16-Oct-12 20:20
shiv@nand16-Oct-12 20:20 
AnswerRe: CStatusbar and Menubar Background color change Pin
_AnsHUMAN_ 16-Oct-12 20:59
_AnsHUMAN_ 16-Oct-12 20:59 
GeneralRe: CStatusbar and Menubar Background color change Pin
shiv@nand16-Oct-12 21:01
shiv@nand16-Oct-12 21:01 
GeneralRe: CStatusbar and Menubar Background color change Pin
_AnsHUMAN_ 16-Oct-12 21:04
_AnsHUMAN_ 16-Oct-12 21:04 
GeneralRe: CStatusbar and Menubar Background color change Pin
shiv@nand16-Oct-12 22:42
shiv@nand16-Oct-12 22:42 
QuestionCFileDialog is not refreshing Pin
Dansveen16-Oct-12 11:00
Dansveen16-Oct-12 11:00 
AnswerRe: CFileDialog is not refreshing Pin
chaau17-Oct-12 8:59
chaau17-Oct-12 8:59 
GeneralRe: CFileDialog is not refreshing Pin
Dansveen17-Oct-12 9:05
Dansveen17-Oct-12 9:05 
AnswerRe: CFileDialog is not refreshing Pin
chaau17-Oct-12 11:47
chaau17-Oct-12 11:47 
GeneralRe: CFileDialog is not refreshing Pin
Dansveen18-Oct-12 2:04
Dansveen18-Oct-12 2:04 
Question#define USBERR(format,...) ... generates C2010 error. Why? Pin
Vaclav_16-Oct-12 5:37
Vaclav_16-Oct-12 5:37 
AnswerRe: #define USBERR(format,...) ... generates C2010 error. Why? Pin
Jochen Arndt16-Oct-12 6:06
professionalJochen Arndt16-Oct-12 6:06 
GeneralSOLVED Re: #define USBERR(format,...) ... generates C2010 error. Why? Pin
Vaclav_16-Oct-12 6:41
Vaclav_16-Oct-12 6:41 
GeneralRe: #define USBERR(format,...) ... generates C2010 error. Why? Pin
luckyty17-Oct-12 17:20
luckyty17-Oct-12 17:20 

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.