Print Page | Close Window

GetMenu() returns NULL

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=616
Printed Date: 23 December 2024 at 7:36pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: GetMenu() returns NULL
Posted By: Asha Udupa
Subject: GetMenu() returns NULL
Date 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

 




Replies:
Posted By: Oleg
Date Posted: 12 April 2004 at 12:01pm
pMenuBar->GetControls()->Add(...);

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


Posted By: Asha Udupa
Date 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?

 



Posted By: Oleg
Date 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


Posted By: Asha Udupa
Date 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?

 



Posted By: Oleg
Date 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



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