Results 1 to 11 of 11

Thread: [RESOLVED] Program Crashing

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    46

    Resolved [RESOLVED] Program Crashing

    Howdy folks

    I have, hopefully a quick question

    I am working with Paolo Giacomuzzi's AppBar application. I have seen it floating around here and at Planet Source Code. Everthing is working so far; but for 1 annoying issue. Whenever I end the app, VB6 itself crashes. I have tried a few different things, including using the terrible "End" keyword.

    I have had to resort to making a 'Loader' form that loads the AppBar. When I now close the appbar, VB does not crash, and I can close the loader form.

    I have only encountered this in one other control a Tab app that I no longer use. I do remember though that there was a debug mode I could use that would resolve this; or am I barking up the wrong tree.

    Anyone else encounter such a problem?

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Program Crashing

    When VB6 crashes, what error message is displayed?

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    46

    Re: Program Crashing

    None.

    The whole app just clears off the screen; like I shut VB6 down for the night.

  4. #4

  5. #5

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    46

    Re: Program Crashing

    Yeah, that is most likely the problem.

    How would I end the app in this case?

  6. #6

  7. #7

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    46

    Re: Program Crashing

    I have tested this way.

    It still crashes VB.

  8. #8
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Program Crashing

    I found the AppBar code here: http://www.koders.com/vb/fidEBCCAED6...A4B3848F5.aspx

    As suspected, it is SubClassing.

    Presumably you call LinkCallback to start it up, and therefore need to call DetachCallback as part of closing that form.

    Leaving that out (or using the End statement, or the IDE button) is guaranteed to crash VB.

  9. #9

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    46

    Re: Program Crashing

    Si, thanks.

    Twice

    I won't be able to test until tonight, but don't doubt it will resolve the issue..that's one

    And thanks again for that site. I have never been there before ( that I can remember).. very cool site.


    Marking Thread Closed.

  10. #10

    Thread Starter
    Member
    Join Date
    Sep 2007
    Posts
    46

    Re: [RESOLVED] Program Crashing

    UPDATE:

    Hi Guys;

    Si : There was indeed the DetatchCallback in the system. It was in the Form_Unload event. I played around a bit, and by moving it to the Command button calling the end program on the form the application does now end with out crashing the VB Application.

    I threw in a 'DoEvents' for good measure between the AppBar.Detatch and the Unload Form call and everything is running nice and smooth.

    Thank you all for your help.

    peteleeb

  11. #11
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: [RESOLVED] Program Crashing

    That sounds like you have set up the unloading process incorrectly - Form_Unload should be the perfect place for it, as that will work whichever way you can close the form (and should have no additional errors to having it elsewhere).

    It sounds to me as if the code in your command button is not apt - it should be something along the lines of: Unload Me

    For more info, see the article How should I close my form/program/class? from our Classic VB FAQs (in the FAQ forum, which is shown near the top of our home page)

    Of course if you want to post the code, we can check it for you.

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