Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Need help onsending message between two windows.

Need help onsending message between two windows.

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpc++visual-studioquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jocblack
    wrote on last edited by
    #1

    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

    N D 2 Replies Last reply
    0
    • J jocblack

      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

      N Offline
      N Offline
      Nibu babu thomas
      wrote on last edited by
      #2

      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[^]

      J 1 Reply Last reply
      0
      • J jocblack

        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

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        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

        J 1 Reply Last reply
        0
        • N Nibu babu thomas

          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[^]

          J Offline
          J Offline
          jocblack
          wrote on last edited by
          #4

          in the header file that I didn't list here.

          1 Reply Last reply
          0
          • D David Crow

            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

            J Offline
            J Offline
            jocblack
            wrote on last edited by
            #5

            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

            D 1 Reply Last reply
            0
            • J jocblack

              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

              D Offline
              D Offline
              David Crow
              wrote on last edited by
              #6

              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

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups