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

C / C++ / MFC

 
QuestionVC++6.0 Interproc Communication Pin
Ylno22-Jan-13 21:59
Ylno22-Jan-13 21:59 
AnswerRe: VC++6.0 Interproc Communication Pin
«_Superman_»22-Jan-13 22:34
professional«_Superman_»22-Jan-13 22:34 
GeneralRe: VC++6.0 Interproc Communication Pin
Ylno22-Jan-13 23:38
Ylno22-Jan-13 23:38 
AnswerRe: VC++6.0 Interproc Communication Pin
David Knechtges23-Jan-13 3:05
David Knechtges23-Jan-13 3:05 
QuestionHow to retrieve the correct range message to update CStatusBar Pin
Vaclav_22-Jan-13 7:51
Vaclav_22-Jan-13 7:51 
AnswerRe: How to retrieve the correct range message to update CStatusBar Pin
«_Superman_»22-Jan-13 18:37
professional«_Superman_»22-Jan-13 18:37 
GeneralRe: How to retrieve the correct range message to update CStatusBar Pin
Vaclav_23-Jan-13 6:01
Vaclav_23-Jan-13 6:01 
AnswerRe: How to retrieve the correct range message to update CStatusBar Pin
Iain Clarke, Warrior Programmer23-Jan-13 20:55
Iain Clarke, Warrior Programmer23-Jan-13 20:55 
Vaclav_Sal wrote:
PostMessage(ID_STATUS_99);


Should that not be

PostMessage (WM_COMMAND, ID_STATUS_99) ?

I presume that you are updating some sort of progress report, in which case I'd recommend just posting a registered window message to your main frame, and letting a message handler there deal with it, rather than handling 100 different messages.

ie:
// Using the message:
PostMessage (CMainFrame::g_rwm_UpdateStatus, nProgress, nProgressMax);

// mainfrm.h

CMainFrame
{
....
static UINT g_rwm_UpdateStatus;
...

// mainfrm.cpp
UINT CMainFrame::g_rwm_UpdateStatus = ::RegisterWindowsMessage (_T("CMainFrame::g_rwm_UpdateStatus"));
...
ON_REGISTERED_MESSAGE(g_rwm_UpdateStatus, OnUpdateStatus)
...


and so on. You don't have to have the message number in the header - you can have many calls to RegisterWindowsMessage in many parts of your code, you just have to use the same string name each time. I use the class/member variable, but you could also use a GUID. Just make sure to comment for your future self.

In another note, when you're debugging Update handler, you can always walk up the call stack to see why you're getting parameters that you do.

Good luck,

Iain.
I am one of "those foreigners coming over here and stealing our jobs". Yay me!

GeneralRe: How to retrieve the correct range message to update CStatusBar Pin
Vaclav_24-Jan-13 4:39
Vaclav_24-Jan-13 4:39 
GeneralRe: How to retrieve the correct range message to update CStatusBar Pin
Iain Clarke, Warrior Programmer24-Jan-13 23:08
Iain Clarke, Warrior Programmer24-Jan-13 23:08 
QuestionHow to process the task bar mouse click event? Pin
yu-jian22-Jan-13 3:50
yu-jian22-Jan-13 3:50 
AnswerRe: How to process the task bar mouse click event? Pin
«_Superman_»22-Jan-13 18:44
professional«_Superman_»22-Jan-13 18:44 
GeneralRe: How to process the task bar mouse click event? Pin
yu-jian23-Jan-13 2:11
yu-jian23-Jan-13 2:11 
Questionhow can draw a panel ? Pin
VCProgrammer22-Jan-13 0:33
VCProgrammer22-Jan-13 0:33 
AnswerRe: how can draw a panel ? Pin
Richard MacCutchan22-Jan-13 3:07
mveRichard MacCutchan22-Jan-13 3:07 
GeneralRe: how can draw a panel ? Pin
VCProgrammer22-Jan-13 17:35
VCProgrammer22-Jan-13 17:35 
GeneralRe: how can draw a panel ? Pin
Richard MacCutchan22-Jan-13 21:52
mveRichard MacCutchan22-Jan-13 21:52 
GeneralRe: how can draw a panel ? Pin
VCProgrammer22-Jan-13 23:32
VCProgrammer22-Jan-13 23:32 
GeneralRe: how can draw a panel ? Pin
Richard MacCutchan23-Jan-13 1:00
mveRichard MacCutchan23-Jan-13 1:00 
Questionc++ implementation of a linked list. Pin
neo2922-Jan-13 0:31
neo2922-Jan-13 0:31 
AnswerRe: c++ implementation of a linked list. Pin
Maximilien22-Jan-13 1:35
Maximilien22-Jan-13 1:35 
AnswerRe: c++ implementation of a linked list. Pin
Sivaraman Dhamodharan22-Jan-13 2:42
Sivaraman Dhamodharan22-Jan-13 2:42 
QuestionHaving problem with catching WM_LBUTTONUP message in CScrollBar Pin
Bee cute21-Jan-13 23:52
Bee cute21-Jan-13 23:52 
AnswerRe: Having problem with catching WM_LBUTTONUP message in CScrollBar Pin
Richard MacCutchan21-Jan-13 23:57
mveRichard MacCutchan21-Jan-13 23:57 
GeneralRe: Having problem with catching WM_LBUTTONUP message in CScrollBar Pin
Bee cute22-Jan-13 14:36
Bee cute22-Jan-13 14: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.