![]() |
SetTag() problem |
Post Reply ![]() |
Author | |
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() 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 |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Have to work.
Try to comment LoadCommandBars - maybe you restore layout that didn't have Tag set.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
znakeeye ![]() Senior Member ![]() ![]() Joined: 26 July 2006 Status: Offline Points: 1672 |
![]() ![]() ![]() ![]() ![]() |
Yep, you're right! Clearing the registry solved it!
Thanks!
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |