Need help onsending message between two windows.
-
I have a project that is a note book (i.e. tab-- TabCtrl and and Pages). These tabpages are default with MS Visual Studio C++6. For the sake of the argument, I called them page1, 2, 3, and 4. Page1 will have a button that notifies other pages (2-4) to take some action. The message map is WM_CHANGESOMETHING. Page1 code (sender): void Page1::OnButtonClick(){ SendMessage(WM_FLIGHTCHANGE); } Page2' header file(recipient): //{{AFX_MSG(CTabSheet2) virtual BOOL OnInitDialog(); afx_msg LRESULT OnFlightChange(WPARAM wParam, LPARAM lParam); //}}AFX_MSG DECLARE_MESSAGE_MAP() Page2'Body Message Mapping: BEGIN_MESSAGE_MAP(CTabSheet2, CDialog) //{{AFX_MSG_MAP(CTabSheet2) ON_WM_SHOWWINDOW() ON_MESSAGE(WM_FLIGHTCHANGE, OnFlightChange) //}}AFX_MSG_MAP END_MESSAGE_MAP() Page2'Body Implementation: LRESULT CTabSheet2::OnFlightChange(wParam, lParam) { int a; return (LRESULT)0; } Problem, when compile and link, I get the error message listed below. fatal error C1010: unexpected end of file while looking for precompiled header directive Any one know what the problem is? Thanks Bill
-
I have a project that is a note book (i.e. tab-- TabCtrl and and Pages). These tabpages are default with MS Visual Studio C++6. For the sake of the argument, I called them page1, 2, 3, and 4. Page1 will have a button that notifies other pages (2-4) to take some action. The message map is WM_CHANGESOMETHING. Page1 code (sender): void Page1::OnButtonClick(){ SendMessage(WM_FLIGHTCHANGE); } Page2' header file(recipient): //{{AFX_MSG(CTabSheet2) virtual BOOL OnInitDialog(); afx_msg LRESULT OnFlightChange(WPARAM wParam, LPARAM lParam); //}}AFX_MSG DECLARE_MESSAGE_MAP() Page2'Body Message Mapping: BEGIN_MESSAGE_MAP(CTabSheet2, CDialog) //{{AFX_MSG_MAP(CTabSheet2) ON_WM_SHOWWINDOW() ON_MESSAGE(WM_FLIGHTCHANGE, OnFlightChange) //}}AFX_MSG_MAP END_MESSAGE_MAP() Page2'Body Implementation: LRESULT CTabSheet2::OnFlightChange(wParam, lParam) { int a; return (LRESULT)0; } Problem, when compile and link, I get the error message listed below. fatal error C1010: unexpected end of file while looking for precompiled header directive Any one know what the problem is? Thanks Bill
jocblack wrote:
fatal error C1010: unexpected end of file while looking for precompiled header directive
Where is your #include "stdafx.h" directive.
Nibu thomas A Developer Programming tips[^] My site[^]
-
I have a project that is a note book (i.e. tab-- TabCtrl and and Pages). These tabpages are default with MS Visual Studio C++6. For the sake of the argument, I called them page1, 2, 3, and 4. Page1 will have a button that notifies other pages (2-4) to take some action. The message map is WM_CHANGESOMETHING. Page1 code (sender): void Page1::OnButtonClick(){ SendMessage(WM_FLIGHTCHANGE); } Page2' header file(recipient): //{{AFX_MSG(CTabSheet2) virtual BOOL OnInitDialog(); afx_msg LRESULT OnFlightChange(WPARAM wParam, LPARAM lParam); //}}AFX_MSG DECLARE_MESSAGE_MAP() Page2'Body Message Mapping: BEGIN_MESSAGE_MAP(CTabSheet2, CDialog) //{{AFX_MSG_MAP(CTabSheet2) ON_WM_SHOWWINDOW() ON_MESSAGE(WM_FLIGHTCHANGE, OnFlightChange) //}}AFX_MSG_MAP END_MESSAGE_MAP() Page2'Body Implementation: LRESULT CTabSheet2::OnFlightChange(wParam, lParam) { int a; return (LRESULT)0; } Problem, when compile and link, I get the error message listed below. fatal error C1010: unexpected end of file while looking for precompiled header directive Any one know what the problem is? Thanks Bill
jocblack wrote:
Page1 will have a button that notifies other pages (2-4) to take some action.
Why aren't you using
QuerySiblings()
for this?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
jocblack wrote:
fatal error C1010: unexpected end of file while looking for precompiled header directive
Where is your #include "stdafx.h" directive.
Nibu thomas A Developer Programming tips[^] My site[^]
-
jocblack wrote:
Page1 will have a button that notifies other pages (2-4) to take some action.
Why aren't you using
QuerySiblings()
for this?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
-
QuerySibling is unavailable because I didn't setup the property sheet, I used property control default that came with MFC. Dave, have you used the "ON_MESSAGE" before and did you have any luck with it. Thanks Bill
jocblack wrote:
...I didn't setup the property sheet...
Which means what exactly?
jocblack wrote:
I used property control default...
What is this?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb