Print Page | Close Window

Xtreme toolkit & vs2005

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=2289
Printed Date: 27 September 2024 at 6:24pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Xtreme toolkit & vs2005
Posted By: rt15051966
Subject: Xtreme toolkit & vs2005
Date Posted: 27 May 2005 at 12:47pm

how to compile library ver 9.60 with VS2005

there are many error with makro ON_WM_NCHITTEST()

return parameter in new MFC80 is incorect

example:

XTSplitterWnd.cpp

d:\tools\codejock software\mfc\xtreme toolkit pro v9.60\src\controls\common.src\xtsplitterwnd.cpp(91) : error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CXTSplitterWnd::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)'

Cast from base to derived requires dynamic_cast or static_cast

 




Replies:
Posted By: Sven
Date Posted: 28 May 2005 at 9:34am

MS changed the return value for ON_WM_NCHITTEST from UINT to LRESULT, you you have to change your source code too. For 64bit apps this is important because LRESULT is a 64bit value in the x64 world while UINT stays 32bit.

To get compatibility with MFC7 and below I added the following lines in stdafx.h after including the MFC headers:


#if _MFC_VER < 0x0800
#undef ON_WM_NCHITTEST

#define ON_WM_NCHITTEST() \
 { WM_NCHITTEST, 0, 0, 0, AfxSig_u_v_p, \
  (AFX_PMSG)(AFX_PMSGW) \
  (static_cast< LRESULT (AFX_MSG_CALL CWnd::*)(CPoint) > (OnNcHitTest)) },
#endif

So my code compiles fine both with VC6 (customized version of MFC7) and VS2005.



Posted By: rt15051966
Date Posted: 28 May 2005 at 12:24pm
thanks for answer



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