![]() |
CXTPCommandBars on glitch on NT |
Post Reply
|
| Author | |
plamen
Newbie
Joined: 10 August 2004 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Topic: CXTPCommandBars on glitch on NTPosted: 10 August 2004 at 9:05am |
|
Guys,
I noticed a small problem with CXTPCommandBars on Windows NT. It looks like if you create a pop-up a menu with some items disabled, on NT displays them enabled instead. However, it looks like it works fine on XP. To reproduce it build a standard MDI application and add the code below into the view. Cheers, Plamen void CTest2View::OnRButtonDown(UINT nFlags, CPoint point) { ClientToScreen( &point ); CMenu menu; menu.LoadMenu(IDR_POPUPMENU); menu.GetSubMenu(0)->EnableM enuItem(ID_POPUP_DISABLED, MF_BYCOMMAND | MF_DISABLED); UINT iCmdID = CXTPCommandBars::TrackPopupMenu(menu.GetSubMenu(0), TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD, point.x, point.y, AfxGetMainWnd(), NULL); if (iCmdID == ID_POPUP_DISABLED) AfxMessageBox(L"This menu should be disabled..."); CView::OnRButtonDown(nFlags, point); } |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 11 August 2004 at 2:17am |
|
Strange, I can't reproduce it in my NT4 machine :( Can you upload your example? Can you manually debug CXTPCommandBar::LoadMenu and check if info.fState == MFS_DISABLED for ID_POPUP_DISABLED? |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
plamen
Newbie
Joined: 10 August 2004 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 11 August 2004 at 2:26am |
|
Oleg,
I use a clean NT4 Service Pack 6 / IE 5.5. Find the sample attached. Cheers, Plamen 2004-08-11_022548_testpopup.zip |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 11 August 2004 at 12:24pm |
|
Can't reproduce with nt4 sp6.
May be in nt4 you have version earlier than 9.00? TPM_NONOTIFY appeared in 9.00... |
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
plamen
Newbie
Joined: 10 August 2004 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 13 August 2004 at 6:53am |
|
I use the latest - v9.10
Anyway, if you still can't reproduce it I'll dive into your code to find some more info about it. |
|
![]() |
|
Sven
Senior Member
Joined: 21 August 2003 Location: Germany Status: Offline Points: 127 |
Post Options
Thanks(0)
Quote Reply
Posted: 14 August 2004 at 1:42pm |
|
Since NT4/W95 the size of MENUITEMINFO has been changed. If you compile the toolkit with the latest Platform SDK and WINVER >= 0x0500 you have to adjust the MENUITEMINFO size in CXTPCommandBar::LoadMenu.
|
|
![]() |
|
plamen
Newbie
Joined: 10 August 2004 Status: Offline Points: 6 |
Post Options
Thanks(0)
Quote Reply
Posted: 16 August 2004 at 10:58am |
|
Sven,
Thanks for your reply. What I don't understand is how the new MENUITEMINFO size could affect the state of the menu under NT - fState field is part of the NT's MENUITEMINFO as well. I can imagine that some of the new added flags/fields may not work on NT but, hey, that's why there weren't part of the original NT structure. Btw does this mean that you've managed to reproduce it and fixed it that way? Cheers Plamen |
|
![]() |
|
Sven
Senior Member
Joined: 21 August 2003 Location: Germany Status: Offline Points: 127 |
Post Options
Thanks(0)
Quote Reply
Posted: 18 August 2004 at 3:27am |
|
NT4 compares the size you specify in MENUITEMINFO.cbSize with the size of the old MENUITEMINFO size. If the size is not equal the function returns with an error code and the values of MENUITEMINFO remain uninitialized. You can test this if you set a breakpoint in CXTPCommandBar::LoadMenu. |
|
![]() |
|
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 |