Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
Possible bug 64 bit version - RemoveForm
I was working in our OI10 system and may have found an issue. I'm hoping it is just how we ended up calling all of the commands. We have a console multi page screen, which has a SRP.PANEL.1. We are embedding a dynamically created window structure that contains a few shell.explorer objects. All of this works fine until we use the RemoveForm on the panel later when we destroy the window embedded in the panel to put a new one in.
When I check for handles, anything that was a shell.explorer ole control was not removed and still exists. I found this as when we added the new structure to the panel later, if anything had a similar name as the ole controls that could not be removed, they would be left out and the panel would not have the window structure I want.
I updated my code to check for handles and if they exist do a manual utility destroy on the controls that couldn't be removed to get around this, but this wasn't acting the same way in the 32 bit version of the same screen/panels.
Don't know if something changed that we need to change our code for or if something in OI10 is reacting differently, but thought I'd post here in case someone ran into this before.
When I check for handles, anything that was a shell.explorer ole control was not removed and still exists. I found this as when we added the new structure to the panel later, if anything had a similar name as the ole controls that could not be removed, they would be left out and the panel would not have the window structure I want.
I updated my code to check for handles and if they exist do a manual utility destroy on the controls that couldn't be removed to get around this, but this wasn't acting the same way in the 32 bit version of the same screen/panels.
Don't know if something changed that we need to change our code for or if something in OI10 is reacting differently, but thought I'd post here in case someone ran into this before.
Comments
Just so I get a clear picture. You are creating a whole form dynamically and using SetForm to embed it into the Panel control? And when you use RemoveForm to remove it, it's leaving behind ShellExplorers? Are they being left in memory or are they visible on the panel? Is RemoveForm being called before the form is dynamically destroyed?
I'm interested to know your design goal, that is, the reason for swapping out dynamically created forms. The panel also supports AddNamedForm and other related properties and methods to support the ability to embed multiple forms but only show one at a time.
We're doing this as the screen in question is a console of sorts where users select a number of gauges to be visible on the form, and we thus dynamically add those gauges based on choices. They can add and remove them on the fly. Most of the controls in each gauge are simple buttons and labels, except for one shell.explorer object per gauge to have the actual visual gauge we show the user.
When we use the RemoveForm with destroy set, we visibly see everything gone, but if we check for control handles, we can still see any of the controls that were that shell.explorer. The rest of the controls are properly destroyed. I compared to the 9.4 system, and this is only happening in the OI10 system (if that helps) with the same code.