Click here to Skip to main content
11,479,034 members (62,009 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VC6 VC8.0 MFC
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
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
ON_NOTIFY_REFLECT(WM_NOTIFY, OnNotify )macro funtion. 
So please suggest me how to get it done.

Thanking You
saffiuddin
Posted 31-Oct-12 3:18am
Edited 31-Oct-12 3:31am
nv331.7K
v2
Comments
nv3 at 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 at 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.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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.
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Make sure that return type for 'OnNotify'is always LRESULT entire your solution.
  Permalink  
Comments
Richard MacCutchan at 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)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 200
1 F-ES Sitecore 195
2 Frankie-C 120
3 OriginalGriff 105
4 DamithSL 95
0 Sergey Alexandrovich Kryukov 7,880
1 OriginalGriff 7,341
2 Sascha Lefèvre 3,064
3 Maciej Los 2,491
4 Richard Deeming 2,335


Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 9 Apr 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100