Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - CXTPOffice2007FrameHook and ON_MESSAGE
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPOffice2007FrameHook and ON_MESSAGE

 Post Reply Post Reply
Author
Message
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Topic: CXTPOffice2007FrameHook and ON_MESSAGE
    Posted: 04 February 2007 at 1:01pm
If you derive the CMainFrame from CXTPMDIFrameWnd and CXTPOffice2007FrameHook the ON_MESSAGE macro doesn't work any longer.

error C2440: 'type cast' : cannot convert from 'void (__thiscall CMainFrame::*)(unsigned int,long)' to 'long (__thiscall CWnd::*)(unsigned
 int,long)'



As a workaround I've made my own macro, maybe you can come up with a better solution?


#define XTP_ON_MESSAGE(message, className, memberFxn) \
    { message, 0, 0, 0, AfxSig_lwl, \
        (AFX_PMSG)(void (className::*)(void))(LRESULT (AFX_MSG_CALL className::*)(WPARAM, LPARAM))&memberFxn },

Codejock support
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 05 February 2007 at 1:28am
Hi,
 
Looks like right error for me.
Instead "void" you have return "LRESULT"...
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 05 February 2007 at 2:49am
Dang, you're right, ON_MESSAGE handlers should return a LRESULT.
It's so obvious that I haven't stumbled about that

Codejock support
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.219 seconds.