Print Page | Close Window

CXTPMenuBar - attach to non-MFC frame?

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=2305
Printed Date: 08 November 2025 at 6:52am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPMenuBar - attach to non-MFC frame?
Posted By: Matchay
Subject: CXTPMenuBar - attach to non-MFC frame?
Date Posted: 01 June 2005 at 3:28am

Hello!

I'd like to implement CXTPMenuBar into our application. The thing is the main application window has been written long ago in API, pure C. It's got nothing to do with any of CFrameWnd classes. Now I am going to "modernize" the UI a little but it's not possible to rewrite the main window in MFC. Don't ask me why - there's a lot of old reasons. The menus are dynamic and they are implemented in a separate dll, using CreateMenu(),SetMenu(),... API set of functions.

My question is of course: is it at all possible to implement CXTPMenuBar in that enviroment? If I don't have a "proper" CXTPFrameWnd-derived window how can I initialize the whole environment which is normally done at OnCreate()?

Best regards!

Maciej




Replies:
Posted By: Oleg
Date Posted: 03 June 2005 at 1:35am
Sorry, CommandBars can't be used without CFrameWnd.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Matchay
Date Posted: 06 June 2005 at 3:33am

A simple trick works. I created an object inherited from CXTPFrameWnd and then attached a main application window (with its handle) to the object. I had to manually initialize the environment (no OnCreate function) but it works. I got the whole XTPFrame at the main application window - menus, toolbars... We'll see!

Regards!

Maciej




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