Click here to Skip to main content
15,888,286 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Raeding and parsing mails via POP3 Pin
Rozis20-Jan-10 14:06
Rozis20-Jan-10 14:06 
Questionproblem with stack structure implementation in C, plz help !!! Pin
hung2h20-Jan-10 3:14
hung2h20-Jan-10 3:14 
AnswerRe: problem with stack structure implementation in C, plz help !!! Pin
Richard MacCutchan20-Jan-10 3:38
mveRichard MacCutchan20-Jan-10 3:38 
GeneralRe: problem with stack structure implementation in C, plz help !!! Pin
hung2h20-Jan-10 3:52
hung2h20-Jan-10 3:52 
GeneralRe: problem with stack structure implementation in C, plz help !!! Pin
hung2h20-Jan-10 4:07
hung2h20-Jan-10 4:07 
GeneralRe: problem with stack structure implementation in C, plz help !!! Pin
Tim Craig20-Jan-10 12:45
Tim Craig20-Jan-10 12:45 
GeneralRe: problem with stack structure implementation in C, plz help !!! Pin
hung2h20-Jan-10 17:57
hung2h20-Jan-10 17:57 
QuestionPostMessage vs SendMessage Pin
Caslen20-Jan-10 2:17
Caslen20-Jan-10 2:17 
MFC, VS6.0, C++

From within a thread I have used SendMessage() to flag an error and display an acknowledge dialog using AfxMessageBox, it's a simple 'An error has occurred press ok' kind of message and then it returns with return 0 eg:-

LRESULT CMainFrame::OnError(WPARAM wParam, LPARAM lParam)
{
switch (wParam)
{
case 1:
AfxMessageBox("Error 1 - Press OK");
break;
case 2:
AfxMessageBox("Error 2 - Press OK");
break;
}
return 0;
}

The problem is that the calling thread is 'hanging' after I click ok in the dialog box even though the only line after that is return 0. If I use PostMessage instead of SendMessage then the problem doesn't occur.

As I understand it SendMessage will wait until the message has been processed before continuing where PostMessage simply pops the message into the message queue and returns. I'm not quite sure what is going on here, obviously in the first case the message is not being flagged as completed so SendMessage never finishes but why? Any Ideas?
AnswerRe: PostMessage vs SendMessage Pin
CPallini20-Jan-10 2:44
mveCPallini20-Jan-10 2:44 
GeneralRe: PostMessage vs SendMessage Pin
Caslen20-Jan-10 3:26
Caslen20-Jan-10 3:26 
GeneralRe: PostMessage vs SendMessage Pin
CPallini20-Jan-10 3:28
mveCPallini20-Jan-10 3:28 
GeneralRe: PostMessage vs SendMessage Pin
Caslen20-Jan-10 5:12
Caslen20-Jan-10 5:12 
GeneralRe: PostMessage vs SendMessage Pin
Joe Woodbury20-Jan-10 6:36
professionalJoe Woodbury20-Jan-10 6:36 
GeneralRe: PostMessage vs SendMessage Pin
Caslen20-Jan-10 9:08
Caslen20-Jan-10 9:08 
GeneralRe: PostMessage vs SendMessage Pin
Joe Woodbury20-Jan-10 9:46
professionalJoe Woodbury20-Jan-10 9:46 
Questionfind folder list on a root folder Pin
Game-point20-Jan-10 1:59
Game-point20-Jan-10 1:59 
QuestionRe: find folder list on a root folder Pin
David Crow20-Jan-10 2:50
David Crow20-Jan-10 2:50 
AnswerRe: find folder list on a root folder Pin
Richard MacCutchan20-Jan-10 2:50
mveRichard MacCutchan20-Jan-10 2:50 
AnswerRe: find folder list on a root folder Pin
Graham Breach20-Jan-10 2:54
Graham Breach20-Jan-10 2:54 
QuestionWhat is Data Directory in PE file format ? Why? Pin
glitteringsound20-Jan-10 0:52
glitteringsound20-Jan-10 0:52 
QuestionRe: What is Data Directory in PE file format ? Why? Pin
David Crow20-Jan-10 2:51
David Crow20-Jan-10 2:51 
AnswerRe: What is Data Directory in PE file format ? Why? Pin
Richard MacCutchan20-Jan-10 2:53
mveRichard MacCutchan20-Jan-10 2:53 
Questionproblem with stack structure in C++(using pointer), plz help !!! Pin
hung2h19-Jan-10 23:00
hung2h19-Jan-10 23:00 
AnswerRe: problem with stack structure in C++(using pointer), plz help !!! Pin
Cedric Moonen19-Jan-10 23:28
Cedric Moonen19-Jan-10 23:28 
GeneralRe: problem with stack structure in C++(using pointer), plz help !!! Pin
hung2h19-Jan-10 23:43
hung2h19-Jan-10 23:43 

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.