FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Menu stops working after several hours working in applicatio
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: Menu stops working after several hours working in applicatio
Posted: Mon Jan 12, 2009 11:09 AM

Antonio,

it doesn't work for us, probably because we don't use these 'temporary' menus only for contextmenu but also for mdi-childs: If we open mdi-child "a", there is a main menu generatet, for example with the id's 20500-20510, then we open mdi-child "b" with the id's 20511-20520. Now "a" again gets the focus and 20500-20510 are being displayes. We close "a", but "b" is still open. But by the end-method, the id's 20511-20520 get destroyed however they are being showed. I think if you only generate context-menus that are directly destroyed after generating, it might work, but not with menus for mdi-childs.

And because of these mdi-childs the use of new id's is more elevated than in other programs, I think. Some mdi-childs use up to 100 ID's, and if you close and open these windows again and again, you can use these roughly 12.000 id's in little time.

Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Menu stops working after several hours working in applicatio
Posted: Mon Jan 12, 2009 12:53 PM

Gilbert,

Please place a call to MsgBeep() in Class TMenuItem Method End() and check if the menuitems are getting destroyed when a MDICHILD window is closed.

They should be destroyed.

It doesn't matter if nInitId value is below the used menuitems ids, as those values are already in use by the menuitems. I mean: if the menu is created and if we decrease nInitId later on, the existing menuitems will keep their ids.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: Menu stops working after several hours working in applicatio
Posted: Wed Jan 14, 2009 12:35 PM

Antonio,

when I add menuitem.prg to my makefile, I get the errormessage: _HB_FUN___ADDACCEL referenced from menuitem.obj

Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Menu stops working after several hours working in applicatio
Posted: Thu Jan 15, 2009 01:27 AM

Gilbert,

For a test, please add a dummy function:

function __ADDACCEL()

return nil

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 274
Joined: Fri Apr 04, 2008 01:25 PM
Re: Menu stops working after several hours working in applicatio
Posted: Fri Jan 16, 2009 09:04 AM

Antonio,

so, I tested it now, but as I suspected: when I open first window "WA" with menu "MA", it stays open. I open window "WB" with Menu "MB", then focus again to WA, close it, then MA is closed. When I now also close WB with MB, and open a new window "WC" with menu MC, this menu won't work at all. These menus are menus that belong to a Window, so it are not right-click-menus, that open and close in the same order, but sometimes there are 2, 3 or 4 menus in memory, than you close something, open another window and menu and so on. In these cases, I think the menuitem ID isn't clearly allocated anymore to the menuitem.

(The methods New() and ReDefine() in menuitem.prg should return Self instead of Nil)

Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de

Continue the discussion