![]() |
Correct base class in MFC macro? |
Post Reply
|
| Author | |
Warren
Groupie
Joined: 23 February 2005 Status: Offline Points: 64 |
Post Options
Thanks(0)
Quote Reply
Topic: Correct base class in MFC macro?Posted: 08 December 2006 at 1:07pm |
|
I was wondering about the proper base class in the MFC macros, when you multiply derive something. In the shortcutbar sample, the .h file looks like:
class CMainFrame : public CXTPFrameWnd, CXTPOffice2007FrameHook { DECLARE_DYNCREATE(CMainFrame) ... and the .cpp file looks like: IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd) BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd) ... I would have thought that the second parameter to these macros should be CXTPFrameWnd ? I haven't used multiple-derivation with my own MFC classes much, mainly because of this issue. My assumption would be that you're okay to do this: 1) as long as the second class doesn't also derive from MFC's CObject, 2) you use the CObject derived name in the MFC macros, so the messages get passed to the right class. Everything seems to be working fine as is, I'm just nervous about doing something wrong, so I'd appreciate a codejock comment on the issue. Thanks very much Warren P.S. I'm using version 10.3.1 of the 'kit |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 15 December 2006 at 2:04pm |
|
you right, you can do it. 1. right.
2. right. only CCmdTarget....
better use CXTPFrameWnd. Message maps/dyanamic checking don't use now for CXTPFrameWnd, but how knows may be later we will add something...
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |