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. How do u pass parameters to OnKillfocus...

How do u pass parameters to OnKillfocus...

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
3 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.
  • I Offline
    I Offline
    IrishSonic
    wrote on last edited by
    #1

    Hiya, I need to pass parameters to my OnEnKillfocus funtion. This is what I have tried: // class declaration afx_msg void OnEnKillfocusRetrogroup2(long); // function void CGroupBranchRetro::OnEnKillfocusRetrogroup2(long overrider1) { // code } These are fine but it fails on my message map i.e BEGIN_MESSAGE_MAP(CGroupBranchRetro, CDialog) ON_EN_KILLFOCUS(IDC_RETROGROUP1, OnEnKillfocusRetrogroup1) ON_EN_KILLFOCUS(IDC_RETROGROUP2, OnEnKillfocusRetrogroup2) END_MESSAGE_MAP() The error I get is: error C2440: 'static_cast' : cannot convert from 'void (__thiscall CGroupBranchRetro::* )(long)' to 'AFX_PMSG' Does anyone know how to pass parameters on OnKillfocus function properly?? Thanks, grahamoj.

    N T 2 Replies Last reply
    0
    • I IrishSonic

      Hiya, I need to pass parameters to my OnEnKillfocus funtion. This is what I have tried: // class declaration afx_msg void OnEnKillfocusRetrogroup2(long); // function void CGroupBranchRetro::OnEnKillfocusRetrogroup2(long overrider1) { // code } These are fine but it fails on my message map i.e BEGIN_MESSAGE_MAP(CGroupBranchRetro, CDialog) ON_EN_KILLFOCUS(IDC_RETROGROUP1, OnEnKillfocusRetrogroup1) ON_EN_KILLFOCUS(IDC_RETROGROUP2, OnEnKillfocusRetrogroup2) END_MESSAGE_MAP() The error I get is: error C2440: 'static_cast' : cannot convert from 'void (__thiscall CGroupBranchRetro::* )(long)' to 'AFX_PMSG' Does anyone know how to pass parameters on OnKillfocus function properly?? Thanks, grahamoj.

      N Offline
      N Offline
      Nicolas Bonamy
      wrote on last edited by
      #2

      Where the value of that parameter should come from?

      1 Reply Last reply
      0
      • I IrishSonic

        Hiya, I need to pass parameters to my OnEnKillfocus funtion. This is what I have tried: // class declaration afx_msg void OnEnKillfocusRetrogroup2(long); // function void CGroupBranchRetro::OnEnKillfocusRetrogroup2(long overrider1) { // code } These are fine but it fails on my message map i.e BEGIN_MESSAGE_MAP(CGroupBranchRetro, CDialog) ON_EN_KILLFOCUS(IDC_RETROGROUP1, OnEnKillfocusRetrogroup1) ON_EN_KILLFOCUS(IDC_RETROGROUP2, OnEnKillfocusRetrogroup2) END_MESSAGE_MAP() The error I get is: error C2440: 'static_cast' : cannot convert from 'void (__thiscall CGroupBranchRetro::* )(long)' to 'AFX_PMSG' Does anyone know how to pass parameters on OnKillfocus function properly?? Thanks, grahamoj.

        T Offline
        T Offline
        TomKat
        wrote on last edited by
        #3

        SendMessage(hwnd,WM_KILLFOCUS,(WPARAM)Wnd,0); //simple as that ! use Cwnd->m_hwnd to get hwnd ! //rate me or hate me I am the mighty keeper of the book on knowledge . Contact me to get your copy .

        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