Print Page | Close Window

SetTag() problem

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=11623
Printed Date: 28 February 2025 at 10:01pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SetTag() problem
Posted By: znakeeye
Subject: SetTag() problem
Date 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



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


Posted By: znakeeye
Date Posted: 29 July 2008 at 4:10am
Yep, you're right! Clearing the registry solved it!
 
Thanks!



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