layered popupmenu's | developer.brewmp.com layered popupmenu's | developer.brewmp.com

Developer

layered popupmenu's

Hello all,
I'm working on a set of "nested" popup menus. These take the form of popup menus that are basically layered on top of each other. Once I create the popup, I query for the Form interface to add a select handler and to push onto the root form. Now the trouble comes when I try to clean up the popup. After I pop the menu off the root form, I release the IPopupMenu which works fine. I also try to release the IForm that was queried when I started. This works fine on the bottom form, but any forms layered on top of it will produce a crash if I try to release the IForm. When I load it onto the device, things are even worse, I think the release of the IPopupMenu is crashing (though I haven't pinpointed this yet). It would appear as if some of the resources are shared between these menus (although if they are incrementing the ref count, I don't see how this would be a problem).

Does anyone have any insight on this? Also, if there is a better approach that someone has in mind, I'd appreciate hearing it.

Thanks
-Al

Are you using BUIW 1.2.4? If so, have you applied the U01 patch?
When I moved from 1.2.3 to 1.2.4, I started seeing inexplicable crashes when removing popup forms. They stopped after I applied the patch.

Are you using BUIW 1.2.4? If so, have you applied the U01 patch?
When I moved from 1.2.3 to 1.2.4, I started seeing inexplicable crashes when removing popup forms. They stopped after I applied the patch.

Now, I have revised my approach, and I'm just creating a popupmenu object with AEECLSID_POPUPMENUFORM_SCROLL, then use IPOPUPMENU_TO_IFORM to push the form, etc.
With this strategy, all I do is try to IPOPUPMENU_Release() the menu, and that crashes. I have also produced the problem in normal, non-layered popups. Also, I'm using gcc to compile, so that may have some influence...

Now, I have revised my approach, and I'm just creating a popupmenu object with AEECLSID_POPUPMENUFORM_SCROLL, then use IPOPUPMENU_TO_IFORM to push the form, etc.
With this strategy, all I do is try to IPOPUPMENU_Release() the menu, and that crashes. I have also produced the problem in normal, non-layered popups. Also, I'm using gcc to compile, so that may have some influence...

Also, I'm getting BPOINT type 3, and I'm using BUIW 1.2.3. I've tried upgrading to 1.2.4 and I get the same results. I'm not sure if I applied the 1.2.4 patch update, but they seem to have pulled 1.2.4 from the site, so I couldn't try installing it.

Also, I'm getting BPOINT type 3, and I'm using BUIW 1.2.3. I've tried upgrading to 1.2.4 and I get the same results. I'm not sure if I applied the 1.2.4 patch update, but they seem to have pulled 1.2.4 from the site, so I couldn't try installing it.

For the record, it appears the problem was caused by my using wide string constants to add items to the menu. It was trying to free them, causing it to crash. So, I resolved by using WSTRDUP on the constants. Probably the best way would be to use IMENUMODEL_SetPfnFree() to setup a func that doesn't free string constants.
-Al

For the record, it appears the problem was caused by my using wide string constants to add items to the menu. It was trying to free them, causing it to crash. So, I resolved by using WSTRDUP on the constants. Probably the best way would be to use IMENUMODEL_SetPfnFree() to setup a func that doesn't free string constants.
-Al