Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Correct base class in MFC macro?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Correct base class in MFC macro?

 Post Reply Post Reply
Author
Message
Warren View Drop Down
Groupie
Groupie
Avatar

Joined: 23 February 2005
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote Warren Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 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
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.047 seconds.