Help required to solve erro C2440

  • 12 years ago

    Hi,

            I am working in a porting project (porting from Visual studio 6.0 to VS 2005) i have got the following error.

     
    error C2440: 'static_cast' : cannot convert from 'LRESULT (__thiscall CServiceMainThread::* )(WPARAM,LPARAM)' to 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)'

     code in ServiceMainThread.cpp

     BEGIN_MESSAGE_MAP(CServiceMainThread, CWinThread)
        //{{AFX_MSG_MAP(CServiceMainThread)
            //
        //}}AFX_MSG_MAP
        ON_MESSAGE(WM_THREAD_CLOSE, OnThreadClose)         //Venkat  <------ Error Line
    END_MESSAGE_MAP()

    LRESULT CServiceMainThread::OnThreadClose(WPARAM wParam, LPARAM lParam)            //Venkat
    {

    .....

    .....

    return TRUE; 

    }

     

    code in ServiceThreadMain.h
     

    public:
        virtual ~CServiceMainThread();
        BOOL Init();    // 3430A007


        //{{AFX_MSG(CServiceMainThread)

        //}}AFX_MSG
        afx_msg LRESULT OnThreadClose(WPARAM, LPARAM);                    //Venkat

        DECLARE_MESSAGE_MAP()

     

    I have gone through many blogs and made changes like adding the class name in the message pump etc.. but nothing turned my way.. Pls help me to resolve this error.. Thanks in advance... 

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Owning a computer without programming is like having a kitchen and using only the microwave oven” - Charles Petzold