error: 'static_cast' : cannot convert from 'void (__thiscall CShimiHalDlg::* )(void)'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zahraZ
    New Member
    • Jul 2010
    • 17

    error: 'static_cast' : cannot convert from 'void (__thiscall CShimiHalDlg::* )(void)'

    Hello ,
    i want a solution for this error:
    Code:
     'static_cast' : cannot convert from 'void (__thiscall CShimiHalDlg::* )(void)' to 'AFX_PMSG'
    this error occurred when i added a button and writing code for it in a mfc project.
    i searched for it in the web and found some solution like change it's prototype from void to LRESULT i do it but this error occurred:
    Code:
    error C2440: 'static_cast' : cannot convert from 'LRESULT (__thiscall CshimiHalDlg::* )(WPARAM,LPARAM)' to 'AFX_PMSG'
    please get me a solution
    Best Regard
  • hype261
    New Member
    • Apr 2010
    • 207

    #2
    You need to show the line of code where the error is occuring, without that it is going to be very hard to see what is going wrong in your program.

    Comment

    • zahraZ
      New Member
      • Jul 2010
      • 17

      #3
      this is the code of it:
      Code:
      BEGIN_MESSAGE_MAP(CHalManshorDlg, CDialog)
      	ON_BN_CLICKED(IDC_ManshorHal, &CHalManshorDlg::OnBnClickedManshorhal)
      END_MESSAGE_MAP()
      and Here is the definition of OnBnClickedMans horhal() function
      Code:
      void CHalManshorDlg::OnBnClickedManshorhal()
      please solve it.
      thanks very alot

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        You should post where the static cast is being done.

        Posting a macro is not posting the error. You may need to post the macro expansion.

        Comment

        Working...