Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Menu separator & indexes problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Menu separator & indexes problem

 Post Reply Post Reply
Author
Message
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Topic: Menu separator & indexes problem
    Posted: 21 May 2007 at 10:22am
I'm trying to add menu items dynamically.
 
When i'm calling

CXTPControls * submenu = popup->GetCommandBar()->GetControls();

submenu->Add(pControl);
 
It seems to add the item, but when i'm trying to use GetAt or GetCount for items, the new item doesn't seem to be counted, only the original items in the menu are counted.
 
As a result, i'm having problem to finf out whether my menu item has a separator after it, because GetNext in this case fails.
 
While checking for separator before the item via GetBeginGroup is easy, checking for separator after the item seems impossible for dynamic items...
 
Is there something wrong that i'm doing or this is a bug in the library? Anyways, what should i do?
 
Back to Top
Vitaly View Drop Down
Groupie
Groupie


Joined: 05 November 2004
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote Vitaly Quote  Post ReplyReply Direct Link To This Post Posted: 21 May 2007 at 11:05am
nevermind, found the problem, was using global controls collection instead of the submenu's one...
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.047 seconds.