You don't need to explicitly End() TGets, TComboBoxes, TDialogs, etc.
James Bott wrote:Controls like gets and comboboxes, no, but I always end dialogs. How else do you close them?
James Bott wrote:I was just saying that if you are not sure if you need to call End() then it is better to just do it and then you don't have to worry about resource leaks, files left open, etc.
Generally is the user that closes the dialog.
I don't think this is a correct approach. It's always better to know what's going on.
It's even possible (but I'm not sure) that double release can cause some kind of problems.
James Bott wrote:Ah, I guess you mean using the close button on the title bar. I remove those, so the user has to use the buttons on the dialog and the OK or Close button has to call oDlg:end().
James Bott wrote:I guess we would need a complete list of which classes need to be ended by the programmer and which don't.
Antonio Linares wrote:Anyhow, Windows automatically will take care of those GDI objects even if we don't explicity release them, when the app finsihes.
Anyhow, Windows automatically will take care of those GDI objects even if we don't explicity release them, when the app finsihes.
Antonio Linares wrote:Enrico,
http://msdn.microsoft.com/en-us/library/ms724291(VS.85).aspx
"Handles to GDI objects are private to a process."
So when the process is finished, all its environment is cleared, unless you have created global handles (i.e. using GlobalAlloc()).
GDI objects support only one handle per object. Handles to GDI objects are private to a process. That is, only the process that created the GDI object can use the object handle.
Antonio Linares wrote:http://msdn.microsoft.com/en-us/magazine/cc301756.aspx
"... the documentation states that Windows takes care of releasing the resource used by a process when it exits ..."
Even if the documentation states that Windows takes care of releasing the resource used by a process when it exits, this is not enough for server applications that must be extremely reliable.
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 58 guests