Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear bros,
I am converting a vc6 project to vc8 that is visual studio 2005 and I am getting this error. Please suggest a solution to get rid of this.

There is a funtion as following
C++
BOOL CExListCtrl::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) 
{
        HD_NOTIFY   *pHDN = (HD_NOTIFY*)lParam;

        if((pHDN->hdr.code == HDN_BEGINTRACKW || pHDN->hdr.code == HDN_BEGINTRACKA || pHDN->hdr.code == HDN_DIVIDERDBLCLICKA || pHDN->hdr.code == HDN_DIVIDERDBLCLICKW )
                && pHDN->iItem == 5)            // Prevent only first (col# 0) from resizing
        {
                *pResult = TRUE;                // disable tracking
                return TRUE;                    // Processed message
        }
 		 
        return CListCtrl::OnNotify(wParam, lParam, pResult);
}


this is caught by compiler when is passed through
C++
ON_NOTIFY_REFLECT(WM_NOTIFY, OnNotify )macro funtion. 

So please suggest me how to get it done.

Thanking You
saffiuddin
Posted
Updated 31-Oct-12 2:31am
v2
Comments
nv3 31-Oct-12 9:44am    
You are trying to hook a handler for ON_NOTIFY to an ON_NOTIFY_REFLECT event. The compiler is complaining because your handler function should have the signature:

void FuncName (NMHDR* pHdr, LRESULT* pRes);

To fix the function signature would be easy, but I guess the command routing needs some fixing also. Read the MSDN technical note on Message Reflection to understand the background. Then the fix will probably be a breeze.
Jochen Arndt 31-Oct-12 10:07am    
With VS 2005 use the ON_NOTIFY_REFLECT_EX macro for handlers returning a BOOL. This should do the job for specific messages (like the HDN_xxx messages from your handler) but I'm not sure if this can be also used with the WM_NOTIFY message.

It looks like the macro ON_NOTIFY_REFLECT in VC6 is different from the one in VC2005. This may be the result of one environment using the ATL version, and the other the MFC version.
Use the button F12 (with the text cursor blinking in the word ON_NOTIFY_REFLECT) on both environments, it will bring you to the macro definition.

Hope this helps,
Pablo.
 
Share this answer
 
v2
Make sure that return type for 'OnNotify'is always LRESULT entire your solution.
 
Share this answer
 
Comments
Richard MacCutchan 9-Apr-15 9:29am    
This question is more than 2 years old; you are far too late to post this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900