Click here to Skip to main content
15,899,313 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: concat two char * variables Pin
CPallini20-Jan-10 20:51
mveCPallini20-Jan-10 20:51 
GeneralRe: concat two char * variables Pin
Richard MacCutchan20-Jan-10 22:14
mveRichard MacCutchan20-Jan-10 22:14 
QuestionRe: concat two char * variables Pin
CPallini20-Jan-10 22:19
mveCPallini20-Jan-10 22:19 
AnswerRe: concat two char * variables Pin
Richard MacCutchan20-Jan-10 23:15
mveRichard MacCutchan20-Jan-10 23:15 
GeneralRe: concat two char * variables Pin
CPallini20-Jan-10 23:29
mveCPallini20-Jan-10 23:29 
GeneralRe: concat two char * variables Pin
Richard MacCutchan20-Jan-10 23:36
mveRichard MacCutchan20-Jan-10 23:36 
QuestionModal vs Modeless dialog box Pin
msr_codeproject20-Jan-10 6:05
msr_codeproject20-Jan-10 6:05 
AnswerRe: Modal vs Modeless dialog box Pin
Richard MacCutchan20-Jan-10 6:08
mveRichard MacCutchan20-Jan-10 6:08 
AnswerRe: Modal vs Modeless dialog box Pin
Rajesh R Subramanian20-Jan-10 6:58
professionalRajesh R Subramanian20-Jan-10 6:58 
QuestionRaeding and parsing mails via POP3 Pin
VictorSotnikov20-Jan-10 4:52
VictorSotnikov20-Jan-10 4:52 
AnswerRe: Raeding and parsing mails via POP3 Pin
Richard MacCutchan20-Jan-10 5:47
mveRichard MacCutchan20-Jan-10 5:47 
AnswerRe: Raeding and parsing mails via POP3 Pin
Joe Woodbury20-Jan-10 9:48
professionalJoe Woodbury20-Jan-10 9:48 
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 

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.