CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: why VB crashed

  1. #1
    Join Date
    Jun 2001
    Posts
    44

    why VB crashed

    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


  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: why VB crashed

    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
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Jun 2001
    Posts
    44

    Re: why VB crashed

    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


  4. #4
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: ADo and Crystal Report

    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
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  5. #5
    Join Date
    Jun 2001
    Location
    Israel
    Posts
    228

    Re: why VB crashed

    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!
    ----------

  6. #6
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: why VB crashed

    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

  7. #7
    Join Date
    Jun 2001
    Posts
    44

    thanks all reply

    Now it's better
    Thanks again



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured