Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - SetTag() problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SetTag() problem

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

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: SetTag() problem
    Posted: 28 July 2008 at 2:15pm
XTP 11.2.1. Haven't verified this in 12.0.1 yet.
 
SetParameter/GetParameter work.
SetTag/GetTag don't!
 
I have some split-buttons show the same popup menu:
 
int CMainFrame::OnCreateCommandBar(LPCREATEBARSTRUCT lpCreateBar)
{
    // In here I create a popup menu for the buttons:
    CXTPPopupBar* pPopupBar = CXTPPopupBar::CreatePopupBar(GetCommandBars());
    lpCreateBar->pCommandBar = pPopupBar;
    pItem = pPopupBar->GetControls()->Add(...);
    pItem->SetTag(lpCreateBar->nID);
   
}
 
That is, I want to distinguish between these menus, since the menu items have the same identifiers!
 
Later, in my handler I try to retrieve this tag, but it's always 0. If I set a string using SetParameter it will indeed be there when I call GetParameter!
 
BOOL CMainFrame::OnMyCommand(UINT nID, NMHDR* pNMHDR, LRESULT* pResult)
{
 CXTPControl *pControl = ((NMXTPCONTROL*)pNMHDR)->pControl;
 int tag = pControl->GetTag(); // Always 0
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: 29 July 2008 at 1:37am
Have to work.
Try to comment LoadCommandBars - maybe you restore layout that didn't have Tag set.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 29 July 2008 at 4:10am
Yep, you're right! Clearing the registry solved it!
 
Thanks!
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.