Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - bug in designer (w/ fix)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

bug in designer (w/ fix)

 Post Reply Post Reply
Author
Message
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post Topic: bug in designer (w/ fix)
    Posted: 29 May 2004 at 2:14am

Creating a new menu item wih ID 57616 should result in a special MRU control, but it won't because in CXTPControls::Add in XTPControls.cpp the code does not match the code found in CXTPControls::AddMenuItem

AddMenuItem has:

                if (nID == XTP_ID_WINDOWLIST) pControl = (CXTPControl*)CXTPControlWindowList::CreateObject();
                else if (nID == XTP_ID_WORKSPACE_ACTIONS) pControl = (CXTPControl*)CXTPControlWorkspaceActions::CreateObject() ;
                else if (nID == ID_VIEW_TOOLBAR) pControl = (CXTPControl*)CXTPControlToolbars::CreateObject();
                else if (nID == ID_OLE_VERB_FIRST && strCaption == _T("<<OLE VERBS GO HERE>>")) pControl = (CXTPControl*)CXTPControlOleItems::CreateObject();
                else if (nID == ID_FILE_MRU_FILE1) pControl = (CXTPControl*)CXTPControlRecentFileList::CreateObject();
                else pControl = (CXTPControl*)CXTPControlButton::CreateObject();

but Add only has:

            if (nId == XTP_ID_WINDOWLIST) pControl = (CXTPControl*)CXTPControlWindowList::CreateObject();
            else if (nId == XTP_ID_WORKSPACE_ACTIONS) pControl = (CXTPControl*)CXTPControlWorkspaceActions::CreateObject() ;
            else if (nId == ID_VIEW_TOOLBAR) pControl = (CXTPControl*)CXTPControlToolbars::CreateObject();
            else
            pControl = (CXTPControl*)CXTPControlButton::CreateObject();

so copying the basic code regarding ID_FILE_MRU_FILE1 should fix this problem.

well, its sort of a fix, since it causes the app to lock up when you click on the File menu after that...


Edited by Ark42
Back to Top
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post Posted: 29 May 2004 at 10:44am

I think it causes an infinite recursion since CXTPControlRecentFileList::OnCalcDynamicSize calls CXTPControls::Add to add with ID_FILE_MRU_FILE1 - 16

I would propse then XTP_ID_FILE_MRU (35003) and adding:
else if (nId == XTP_ID_FILE_MRU) pControl = (CXTPControl*)CXTPControlRecentFileList::CreateObject();

would probably let you actually create the MRU menu item via the designer editor.
Back to Top
Ark42 View Drop Down
Senior Member
Senior Member
Avatar

Joined: 20 October 2003
Status: Offline
Points: 291
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ark42 Quote  Post ReplyReply Direct Link To This Post Posted: 02 June 2004 at 10:16am

Can a fix like this go into the next version? I added XTP_ID_FILE_MRU to my copy and recompiled and it works fine now, I can create a MRU menu via the designer editor and it works, but only with this modification.

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 03 June 2004 at 12:58am
Added
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.203 seconds.