FreeOperator
February 4th, 2001, 07:18 PM
Hi, there
As is known to all, VB's debugging process can be stopped immediately by clicking the "Run|End" from the VB menu or the "Stop" button on the tool bar. I am wondering what will happen to those controls on the VB form when this run-time environment is closed by force like that. I have written an ATL control with VC and there are some important codes handling the resource-releasing stuff in this control's destruction function. I have a VB program utilizing this ATL control. Everything goes on well if the program is closed normally in VB(such as "Unload Me" or "End") and that ATL control's destruction function will be called to release those resources it created. But, once I stop the debugging by force the way I mentioned above, a message box will pop up in VB saying "this program has executed an invalid operation and will be closed ..." and then the whole VB IDE will be terminated. I believe it is because my ATL control's destruction function is NOT called to do the clean-up job under this circumstance. But this kind of problem won't happen to those Microsoft OCX controls VB carries. How did they walk around it? What should I do? Thanks in advance.
As is known to all, VB's debugging process can be stopped immediately by clicking the "Run|End" from the VB menu or the "Stop" button on the tool bar. I am wondering what will happen to those controls on the VB form when this run-time environment is closed by force like that. I have written an ATL control with VC and there are some important codes handling the resource-releasing stuff in this control's destruction function. I have a VB program utilizing this ATL control. Everything goes on well if the program is closed normally in VB(such as "Unload Me" or "End") and that ATL control's destruction function will be called to release those resources it created. But, once I stop the debugging by force the way I mentioned above, a message box will pop up in VB saying "this program has executed an invalid operation and will be closed ..." and then the whole VB IDE will be terminated. I believe it is because my ATL control's destruction function is NOT called to do the clean-up job under this circumstance. But this kind of problem won't happen to those Microsoft OCX controls VB carries. How did they walk around it? What should I do? Thanks in advance.