Click here to Skip to main content
15,909,835 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Re Post of earlier message - ANSI String in Classes Pin
Tom Moore4-Mar-06 5:01
Tom Moore4-Mar-06 5:01 
GeneralRe: Re Post of earlier message - ANSI String in Classes Pin
Nemanja Trifunovic4-Mar-06 5:20
Nemanja Trifunovic4-Mar-06 5:20 
QuestionStack Overflow, possible cause? Pin
Waldermort4-Mar-06 4:16
Waldermort4-Mar-06 4:16 
AnswerRe: Stack Overflow, possible cause? Pin
Christian Graus4-Mar-06 5:13
protectorChristian Graus4-Mar-06 5:13 
GeneralRe: Stack Overflow, possible cause? Pin
Waldermort4-Mar-06 5:33
Waldermort4-Mar-06 5:33 
GeneralI FOUND IT!!! Pin
Waldermort4-Mar-06 7:57
Waldermort4-Mar-06 7:57 
GeneralRe: I FOUND IT!!! Pin
John R. Shaw4-Mar-06 15:51
John R. Shaw4-Mar-06 15:51 
GeneralRe: I FOUND IT!!! Pin
Waldermort4-Mar-06 21:08
Waldermort4-Mar-06 21:08 
John R. Shaw wrote:
code should be layed out as if{} if else {} if else{}, or you will be wasting processing time.


The origional code was set up like that, but due to these overflow problems I had to comment out certain parts in order to locate the problem.
John R. Shaw wrote:
I hope you find a solution


I have indeed. The documentation on MSDN is a little misleading, It states that when a key is pressed a LVN_KEYDOWN notification is sent to the parent window, the lParam of which holds a pointer to a NMLVKEYDOWN structure. However the documentation doesn't state that the user should first check for the LVN_KEYDOWN. This was my mistake, I was directly checking the value of the NMLVKEYDOWN.

My code now looks like this
case WM_NOTIFY:
    switch(LOWORD(wParam))
    {
        case IDC_LIST:
            if(((LPNMHDR)lParam)->code == NM_DBLCLK) {
                    data->display_student_record();
            }
            else if(((LPNMHDR)lParam)->code == LVN_KEYDOWN) {
                if(((LPNMLVKEYDOWN)lParam)->wVKey == VK_LEFT) {
                    data->display_view_options(ID_VIEW_CLASS);
                }
                else if ((((LPNMLVKEYDOWN)lParam)->wVKey == VK_SPACE)||
			 (((LPNMLVKEYDOWN)lParam)->wVKey == VK_RIGHT)) {
                    data->display_student_record();
                }
            }
            else if(((LPNMHDR)lParam)->code == LVN_ITEMCHANGED) {
                    data->display_extra_data();
            }
        break;
    }
break;

And it is working perfectly, just wish I hadn't changed so much of my code in order in order to find it Frown | :(
GeneralRe: I FOUND IT!!! Pin
John R. Shaw5-Mar-06 14:21
John R. Shaw5-Mar-06 14:21 
Questionmemcat() Pin
chaitanya224-Mar-06 3:44
chaitanya224-Mar-06 3:44 
AnswerRe: memcat() Pin
Gary R. Wheeler4-Mar-06 4:28
Gary R. Wheeler4-Mar-06 4:28 
QuestionAppending arrays Pin
chaitanya224-Mar-06 3:43
chaitanya224-Mar-06 3:43 
AnswerRe: Appending arrays Pin
John R. Shaw4-Mar-06 15:56
John R. Shaw4-Mar-06 15:56 
Questionword counter using threadings Pin
nanjesh4-Mar-06 3:37
nanjesh4-Mar-06 3:37 
AnswerRe: word counter using threadings Pin
Saurabh.Garg4-Mar-06 13:40
Saurabh.Garg4-Mar-06 13:40 
Questionword counter using threadings Pin
nanjesh4-Mar-06 3:36
nanjesh4-Mar-06 3:36 
Questionsimulate a real race condition Pin
zhshqzyc4-Mar-06 2:25
zhshqzyc4-Mar-06 2:25 
QuestionCan I use the ANSI String Class in a normal class Pin
Tom Moore4-Mar-06 1:36
Tom Moore4-Mar-06 1:36 
AnswerRe: Can I use the ANSI String Class in a normal class Pin
Gary R. Wheeler4-Mar-06 1:51
Gary R. Wheeler4-Mar-06 1:51 
Questioncan I do win32 app without vc? Pin
derek74-Mar-06 1:19
derek74-Mar-06 1:19 
AnswerRe: can I do win32 app without vc? Pin
Nemanja Trifunovic4-Mar-06 2:37
Nemanja Trifunovic4-Mar-06 2:37 
QuestionCSocket: Making the application wait till a Blocking call gets over Pin
Spykraft3-Mar-06 23:20
Spykraft3-Mar-06 23:20 
QuestionHow to use WSAAsyncSelect in windows service Pin
milkyhonglee3-Mar-06 22:15
milkyhonglee3-Mar-06 22:15 
AnswerRe: How to use WSAAsyncSelect in windows service Pin
Peter Weyzen4-Mar-06 8:52
Peter Weyzen4-Mar-06 8:52 
GeneralHow about WSAEventSelect? Pin
milkyhonglee4-Mar-06 14:30
milkyhonglee4-Mar-06 14:30 

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.