Click to See Complete Forum and Search --> : why VB crashed
BYaman
October 1st, 2001, 05:11 AM
When debug my application. If I press stop button my vb close suddenly. No error message. No conformation. So I lost my unsaved code.What may be problem. How can I solve it.
I using VB 6.0 SP 5 with SourceSafe
Cimperiali
October 1st, 2001, 05:33 AM
The stop button is equivalent to put an end instruction in code. That means your components do not execute the terminate code, nor even the unload or query unload code. So, if inside your porject you have referenced external components (dll, exe,..) you do not close them correctly. Even some Api (ie: timer Api, ...) require you close smoothly. So, to avoid matter, put a commandbutton on a form, or code you can activate where you need to stop, to unload all opened forms and release all referenced objects.
This should resolve the matter. Before testing, however, let me suggest you to reboot your machine this time: you may have a "dirty" memory situation right now.
Hope this helped.
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
BYaman
October 1st, 2001, 05:52 AM
I use only ADo and Crystal Report. My application has some bug and I want to find it. When I use breakpoints pause my application. Then run step by step. But my problem VB editor close after click stop button in Visual Basic toolbar.Each time I have to reopen project.
thanks
Cimperiali
October 1st, 2001, 06:53 AM
Normally none of above should crhas your application, but we may never say. Let's do some testing:
Open a standard exe project, add a commandbutton to the form, then perform some simple operations (like: Me.caption = "AAA"). Then add a breakpoint, run it then try stopping. Does it crashes like the complex one? If no, try adding ado, establish a connection, reading from a table and try gaing. It crashes? If no, add a Crystal report and try again...
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
deghost
October 1st, 2001, 04:20 PM
hi,
I had a similar problem when i was using a certain DLL. This is also typical to endless or very long loops. Try finding the possible "problematic functions" and put "DoEvents" on both sides of these commands (before and after ofcourse).
then try pushing the Stop button.
----------
The @host is everywhere!
----------
John G Duffy
October 1st, 2001, 04:57 PM
Here is one trick I use when this sort of abort occurs. When debugging and you want to terminate program execution at a certain breakpoint, Wait unti the break triggers then instead of hitting thestop button, executs a UNLOAD ME statement as the next statement to be executed.
I have doe this by typing it in the Immediate window or adding it as the next line to execute or transferring control to a statement within the same subroutine that seay UNLOAD ME. This way VB will get a chance to close open interfaces to ADO Crystal reports, etc
John G
BYaman
October 2nd, 2001, 12:47 AM
Now it's better
Thanks again
:)
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.