![]() |
A derived CXTPToolBar and customization |
Post Reply
|
| Author | ||||
mwest
Newbie
Joined: 13 June 2005 Location: United States Status: Offline Points: 14 |
Post Options
Thanks(0)
Quote Reply
Topic: A derived CXTPToolBar and customizationPosted: 05 August 2005 at 3:25pm |
|||
|
How do you use a custom derived CXTPToolBar class and still keep toolbar customization?
Problem: Getting an “An unsupported operation was attempted” error when the SaveCommandBars method is executed. References: Online Help – use index for ‘SetToolBarClass’ Online Help – use index for ‘cxtpcommandbars’ (look at Add method) Forum - http://forum.codejock.com/forum_posts.asp?TID=1932&K W=SetToolBarClass Demonstration: To see the error, use the ‘Notifications’ sample in ‘…\Samples\CommandBars\Notifications’. Use a custom Toolbar: 1) Create a new toolbar class
2) Define it:
3. Switch the Toolbars in CMainFrame::OnCreate(). Can do this in two different ways. Both produce the same error: A.
B.
4. Build and run it. When you try to close the app, it will give you the error. Please help. I need to find a fix for this fairly soon. Any help is appreciated. Thanks! ![]() |
||||
![]() |
||||
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 05 August 2005 at 11:10pm |
|||
|
You must instead DECLARE_DYNCREATE/IMPLEMENT_DYNCREATE use DECLARE_XTP_COMMANDBAR/ IMPLEMENT_XTP_COMMANDBAR
ps. For custom CXTPControl: DECLARE_XTP_CONTROL/IMPLEMENT_XTP_CONTROL |
||||
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
||||
![]() |
||||
mwest
Newbie
Joined: 13 June 2005 Location: United States Status: Offline Points: 14 |
Post Options
Thanks(0)
Quote Reply
Posted: 08 August 2005 at 4:19pm |
|||
|
Oleg,
Thanks for the reply. Your PS saved me! ![]() However, I found out the hard way that one should not use pointers to controls in a toolbar. It seems that LoadCommandBars() creates new objects. So, anytime I need to reference a control, I have to use the FindControl() method. It is no big deal and it is better programming methodology. Thanks again for your help!!! |
||||
![]() |
||||
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 |