11.2 CommandBars Problem |
Post Reply |
Author | |
terrym
Senior Member Joined: 13 April 2007 Status: Offline Points: 836 |
Post Options
Thanks(0)
Posted: 15 September 2007 at 10:31am |
Our app worked fine for 11.1.3 however with 11.2 we get the following problems:
1. the first time we run our app it is fine, however we have to delete the .xml file or the registry entry CommandBars-Controls from the registry (depending if we save to xml or registry, tried both ways)
However if we close our app and then rerun it it crashes due to GetParent() passing back 0xfeeefeee in the function:
void CXTPControlGallery::InvalidateItems(LPCRECT lpRect, BOOL bAnimate) { GetParent()->Redraw(lpRect ? lpRect : GetRect(), bAnimate); }Any ideas much appreciated please as need to get this working so we can work over the weekend :(
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
please show full stack.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
terrym
Senior Member Joined: 13 April 2007 Status: Offline Points: 836 |
Post Options
Thanks(0)
|
Stack is below as requested, cheers :)
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
terrym
Senior Member Joined: 13 April 2007 Status: Offline Points: 836 |
Post Options
Thanks(0)
|
Also just so you know I have a derived class called CMyXTPControlGallery which just handles OnRButtonUp() and OnDblClick for left mouse button
Cheers
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
terrym
Senior Member Joined: 13 April 2007 Status: Offline Points: 836 |
Post Options
Thanks(0)
|
At point of crash
GetRect() returns -17891602,-17891602,-17891602,-17891602 and m_pParent returns 0xfeeefeee in CXTPControl, not sure if this helps with above stack
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Thanks.
Show all code you have in CMainFrame::OnRibbonBarChanging. Double check it. I think you call methods of wrong object.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
terrym
Senior Member Joined: 13 April 2007 Status: Offline Points: 836 |
Post Options
Thanks(0)
|
If I removed on the ontabchanging function it still happens on next SetCheckedItem called :(
the code is below:
NMXTPTABCHANGE *pNMTabChanged = (NMXTPTABCHANGE *)pNMHDR;
if ( pNMTabChanged->pTab )
{ // do nothing} * pRes = 0;return; but now it crashes in next call to SetCheckedItem() :(
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Show new call stack, and method code where you call SetCheckedItem.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
terrym
Senior Member Joined: 13 April 2007 Status: Offline Points: 836 |
Post Options
Thanks(0)
|
Hi
m_pControlGallery->SetCheckedItem( nIndex != -1 ? nIndex : 0 ); is last setcheckeditem called where m_pControlGallery is a pointer to our CMyXTPGalleryControl derived class and is called from a class called CGalleryControl:
m_pControlGallery = (CMyXTPControlGallery *)pRibbonGroup->Add( new CMyXTPControlGallery, ID_FORMAT_GALLERY ); |
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
terrym
Senior Member Joined: 13 April 2007 Status: Offline Points: 836 |
Post Options
Thanks(0)
|
But the strange thing which is why I dont think it is my code is that it works first run if I remove the XTP CommandBars-Controls from the registry
then 2nd, 3rd try etc. it crashes, like it saves something wrong ???
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
terrym
Senior Member Joined: 13 April 2007 Status: Offline Points: 836 |
Post Options
Thanks(0)
|
The actual error that appears is:
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello,
I _really_ don't like what you have done.
Don't save controls pointers. if user minmize ribbonbar, it will create copy of same control, if usr add gallery to QuickAcess toolbar, control again copy self. and if user add in quick access group with gallery control, group will create copy again. So don't update pointer this way.
Use Update handlers as our samples show.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
terrym
Senior Member Joined: 13 April 2007 Status: Offline Points: 836 |
Post Options
Thanks(0)
|
please explain further as to what you think we are doing wrong ??? please as not sure I understand why this is bad ???
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
terrym
Senior Member Joined: 13 April 2007 Status: Offline Points: 836 |
Post Options
Thanks(0)
|
we do have update handlers, however we have two other classes:
CMyXTPControlGallery which has some overrides of XCTPControlGallery
and also we have a class called CGalleryControl which has lots of functionality we use for our galleries and this class has a pointer passed to it for the gallery control created using CMyXTPControlGallery so that the class can do SetCheckedItem etc. this worked fine in 11.1.3
just not 11.2 ???
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
I just wrote why it is bad. When you call SetCheckedItem for pointer you saved it will update checked item only for main control in Ribbon - not in quick access toolbar, not in Minimized Ribon, etc.
Anyway if you need it, just check if m_pControlGallery->GetParent() != NULL before call its members.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
terrym
Senior Member Joined: 13 April 2007 Status: Offline Points: 836 |
Post Options
Thanks(0)
|
Ok, we are going to start changing our code to work more like the Ribbon Sample, however can you tell me what you think the best way of doing the following is please:
1. selecting a gallery item, as you say not to use SetCheckedItem outside of OnUpdate handler
2. is it safe to store pointers to ribbonbars, command bars etc. ???
Thanks
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
terrym
Senior Member Joined: 13 April 2007 Status: Offline Points: 836 |
Post Options
Thanks(0)
|
The reason we want to select gallery items, eg. is to restore settings once a user reloads app, eg. select same items in gallery
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
terrym
Senior Member Joined: 13 April 2007 Status: Offline Points: 836 |
Post Options
Thanks(0)
|
Ah I see how your Ribbon sample works, let me try that ;) as yes I agree it is better implementation ;)
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
terrym
Senior Member Joined: 13 April 2007 Status: Offline Points: 836 |
Post Options
Thanks(0)
|
Thanks Oleg, once again you save the day, you were right, your implementation is much better and safer, and works great :)
Keep up the great support and apologies for wasting your time, just thought it wasn't our code as it worked in 11.1.3, but our implementation was bad.
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
terrym
Senior Member Joined: 13 April 2007 Status: Offline Points: 836 |
Post Options
Thanks(0)
|
Dynamic Help was not installed :( for 11.2 into VS 2005, I tried installing several times ??? Any ideas please
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
bschaer
Groupie Joined: 27 June 2006 Location: United States Status: Offline Points: 28 |
Post Options
Thanks(0)
|
Immediate replies for a user that had problems due to his own poor coding design and NOT A PEEP regarding RemoveRecordEx/AddRecordEx issues that are CodeJock's fault!!!
|
|
zaksoft
Senior Member Joined: 05 June 2003 Location: Italy Status: Offline Points: 162 |
Post Options
Thanks(0)
|
The problem is not on Oleg that (almost) every days gives answers to everyone on most aspect, the problem is that people answering for reportcontrol leave unaswered question for days (or forever, check...).
We want Oleg also in ReportControl forum!!! |
|
VS2022 - MFC MBCS Statically linked
XTP 23.1 Static Link --------------------------------------------------------- Davide Zaccanti - ZakSoft - www.zaksoft.com |
|
terrym
Senior Member Joined: 13 April 2007 Status: Offline Points: 836 |
Post Options
Thanks(0)
|
Ok all working great with SetCheckedItem() now except what if we have a dynamically changing combo box, eg. ours shows paper sizes :( and if we change it later then not all quick access combo's :( change as same problem
Any ideas around this problem please ?
|
|
Thank you,
Terry Mancey email terry@tmancey.ltd.uk | linkedin www.tmancey.ltd.uk | twitter @tmancey |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello,
Sorry, guys, ReportControl, Calendar and SyntaxEdit are not my controls. I asked my colleague to check the question.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
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 |