Print Page | Close Window

CXTPOffice2007FrameHook and ON_MESSAGE

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=6316
Printed Date: 27 September 2024 at 9:33pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPOffice2007FrameHook and ON_MESSAGE
Posted By: ABuenger
Subject: CXTPOffice2007FrameHook and ON_MESSAGE
Date 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



Replies:
Posted By: Oleg
Date 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


Posted By: ABuenger
Date 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



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net