GetMessage() function is calling itself infnitely (not coming out of loop) -


i implementing similar type of thing- have message box in else part of thecode below..what on debugging - have same message box again , again , dont end (which makes program crash , need restart laptop)..is there solution ??? using mfc application , creating button on window explorer's preview pane. every thing fine problem once if enter in loop below not able come out (i mean there thing in dispatchmessage or translatemessage calls function again , again)..i couldnt find whats ??

please me....or can mail me @ iamshekharsinghshekhawat@gmail.com ...if want ...

the code follow-

while( (bret = getmessage( &msg, null, 0, 0 )) != 0) {      if (bret == -1)     {         // handle error , possibly exit     }     else     {         translatemessage(&msg);          dispatchmessage(&msg);  //onee message box here     } } 

thankyou much...

regards, shekhar singh shekhawat

finally found when return true; in loop control come out of loop(but not in approach) but getmessage not useful me infact when reomved program working fine. in presence having infinite loop. because created dialog using createdialogparam() , dialogproc called through createdialogparam() , used wm_commnands handle message received according application , feel no use of getmessage (please point if wrong)


Comments