Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - GetMenu() returns NULL
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

GetMenu() returns NULL

 Post Reply Post Reply
Author
Message
Asha Udupa View Drop Down
Newbie
Newbie


Joined: 04 February 2004
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Asha Udupa Quote  Post ReplyReply Direct Link To This Post Topic: GetMenu() returns NULL
    Posted: 12 April 2004 at 5:29am

Hi

I have written this in Mainframe.cpp

CXTPCommandBar* pMenuBar = GetCommandBars()->SetMenu(_T("Menu Bar"), IDR_MAINFRAME);

Now if I use GetMenu() it returns NULL. I want to append an item dynamically to the existing menu. Could anyone please help me?

 

Regards

Asha

 

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: 12 April 2004 at 12:01pm
pMenuBar->GetControls()->Add(...);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Asha Udupa View Drop Down
Newbie
Newbie


Joined: 04 February 2004
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Asha Udupa Quote  Post ReplyReply Direct Link To This Post Posted: 12 April 2004 at 11:43pm

Thanks for the infrmation.

Actually I want to append the menu to sub menu. dmething like:

View->Control bar->x,y-Append the menu here.

How can I  dothis using Add() command?

 

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: 17 April 2004 at 5:22am

CXTPControlPopup* pControlView = (CXTPControlPopup*)pMenuBar->GetControl(3);

pControlView->GetCommandBar()->GetControls()->Add(. .)

 

you can add it dynamically. See DynamicPopups sample

 

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Asha Udupa View Drop Down
Newbie
Newbie


Joined: 04 February 2004
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote Asha Udupa Quote  Post ReplyReply Direct Link To This Post Posted: 19 April 2004 at 2:36am

Thanks for the reply.

Still I have a problem

pControlViewNew->GetCommandBar()->GetControls()->Ad d(xtpControlButton,ID_FILE_NEW);

works but

pControlViewNew->GetCommandBar()->GetControls()->Ad d(xtpControlButton, 10, "New", -1, false);

doesn't work. How can I make 2nd statement working?

 

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: 19 April 2004 at 10:52am

What doesn't work?

 "New" is parameter string.

you must call pControl->SetCaption(...).

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.172 seconds.