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. Problem with User Message Maps converting from VC6 to .net 2003

Problem with User Message Maps converting from VC6 to .net 2003

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestioncsharpc++regex
3 Posts 2 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
    jhorstkamp
    wrote on last edited by
    #1

    Hi All, I am converting a project from VC6 to .net2003 and am running into a compiler error with my (user) message maps. I can't see what is wrong - worked fine in VC6... Here is the compiler error: SimParamsDialog.cpp(80) : error C2440: 'static_cast' : cannot convert from 'void (__thiscall CSimParamsDialog::* )(void)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)' None of the functions with this name in scope match the target type Here are the message maps: - these defines are actually in a .h file #define WM_LOADSENSORSTOGRID WM_USER + 1 #define WM_LOADCALDATATOGRID WM_LOADSENSORSTOGRID + 1 BEGIN_MESSAGE_MAP(CSimParamsDialog, CFormView) //{{AFX_MSG_MAP(CSimParamsDialog) ON_BN_CLICKED(IDC_BUTTON_SENDALARM, OnButtonSendAlarm) ON_WM_TIMER() ON_MESSAGE(WM_LOADSENSORSTOGRID, OnLoadSensorsToGrid) ON_MESSAGE(WM_LOADCALDATATOGRID, OnLoadCalDataToGrid) //}}AFX_MSG_MAP END_MESSAGE_MAP() and the function(s): void CSimParamsDialog::OnLoadSensorsToGrid(WPARAM wParam, LPARAM lParam) { etc } void CSimParamsDialog::OnLoadCalDataToGrid(WPARAM wParam, LPARAM lParam) { etc } Any ideas? Again this works in VC6... Thanks John

    P 1 Reply Last reply
    0
    • J jhorstkamp

      Hi All, I am converting a project from VC6 to .net2003 and am running into a compiler error with my (user) message maps. I can't see what is wrong - worked fine in VC6... Here is the compiler error: SimParamsDialog.cpp(80) : error C2440: 'static_cast' : cannot convert from 'void (__thiscall CSimParamsDialog::* )(void)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)' None of the functions with this name in scope match the target type Here are the message maps: - these defines are actually in a .h file #define WM_LOADSENSORSTOGRID WM_USER + 1 #define WM_LOADCALDATATOGRID WM_LOADSENSORSTOGRID + 1 BEGIN_MESSAGE_MAP(CSimParamsDialog, CFormView) //{{AFX_MSG_MAP(CSimParamsDialog) ON_BN_CLICKED(IDC_BUTTON_SENDALARM, OnButtonSendAlarm) ON_WM_TIMER() ON_MESSAGE(WM_LOADSENSORSTOGRID, OnLoadSensorsToGrid) ON_MESSAGE(WM_LOADCALDATATOGRID, OnLoadCalDataToGrid) //}}AFX_MSG_MAP END_MESSAGE_MAP() and the function(s): void CSimParamsDialog::OnLoadSensorsToGrid(WPARAM wParam, LPARAM lParam) { etc } void CSimParamsDialog::OnLoadCalDataToGrid(WPARAM wParam, LPARAM lParam) { etc } Any ideas? Again this works in VC6... Thanks John

      P Offline
      P Offline
      PJ Arends
      wrote on last edited by
      #2

      AFAIK your functions have to return an LRESULT, not a void.

      LRESULT CSimParamsDialog::onloadSensorsToGrid(WPARAM wParam, LPARAM lParam)
      {
      ...
      return 0;
      }

      LRESULT CSimParamsDialog::onloadCalDataToGrid(WPARAM wParam, LPARAM lParam)
      {
      ...
      return 0;
      }


      [

      ](http://www.canucks.com)Sonork 100.11743 Chicken Little "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 Within you lies the power for good - Use it!

      J 1 Reply Last reply
      0
      • P PJ Arends

        AFAIK your functions have to return an LRESULT, not a void.

        LRESULT CSimParamsDialog::onloadSensorsToGrid(WPARAM wParam, LPARAM lParam)
        {
        ...
        return 0;
        }

        LRESULT CSimParamsDialog::onloadCalDataToGrid(WPARAM wParam, LPARAM lParam)
        {
        ...
        return 0;
        }


        [

        ](http://www.canucks.com)Sonork 100.11743 Chicken Little "You're obviously a superstar." - Christian Graus about me - 12 Feb '03 Within you lies the power for good - Use it!

        J Offline
        J Offline
        jhorstkamp
        wrote on last edited by
        #3

        Thanks - that did it! Worked fine in VC6...odd that it didn't catch that. John

        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