Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
Remove Form completely destroys form
I know that sounds like what its supposed to do but...
I have a scenario where I am using setform to do exactly that.
On the close event of the window with the panel I call the remove form method
The problem I'm having is that if I restart the window with the panel, the same code above calling 'Start_Window' doesn't work.
Start_window just returns null to NewWindow so the panel is now empty.
I have to close OI in order for the start_window call to be successful again.
Any thoughts?
I have a scenario where I am using setform to do exactly that.
NewWindow = Start_Window(wname)
Handle = Get_Property(NewWindow, "HANDLE")
Send_Message(PanelCtrl$, "OLE.SetForm", Handle, 1, 1)
That all works fine.On the close event of the window with the panel I call the remove form method
Send_Message(PanelCtrl$, "OLE.RemoveForm", 1)
That seems to work too.The problem I'm having is that if I restart the window with the panel, the same code above calling 'Start_Window' doesn't work.
Start_window just returns null to NewWindow so the panel is now empty.
I have to close OI in order for the start_window call to be successful again.
Any thoughts?
Comments
So the problem seems to be that the destroy doesn't completely destroy rather than the opposite.
It certainly disappears from view but for whatever reason OI thinks its still there and any subsequent call won't work.
Solution is to 'Allow multiple instances' of the window in the form designer
I did give end_window a try and that didn't seem to make an difference.
I could try sending a close event I guess.
I was under the impression though that the purpose of the "Destroy" flag in the removeform method was to close the window. Have I misunderstood that?
It's possible that the letting RemoveForm destroy the window for you is causing OI's Presentation Server to not be notified that the window has died. I'll have to do some more testing on my end.
Thanks for checking