|
-
Aug 20th, 2008, 01:34 PM
#1
Thread Starter
Member
[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?
-
Aug 20th, 2008, 01:35 PM
#2
Re: Program Crashing
When VB6 crashes, what error message is displayed?
-
Aug 20th, 2008, 01:58 PM
#3
Thread Starter
Member
Re: Program Crashing
None.
The whole app just clears off the screen; like I shut VB6 down for the night.
-
Aug 20th, 2008, 02:19 PM
#4
Re: Program Crashing
It or you are probably doing subclassing and ending the app incorrectly.
-
Aug 20th, 2008, 02:35 PM
#5
Thread Starter
Member
Re: Program Crashing
Yeah, that is most likely the problem.
How would I end the app in this case?
-
Aug 20th, 2008, 03:10 PM
#6
Re: Program Crashing
Don't use the IDE's End button.
-
Aug 20th, 2008, 03:18 PM
#7
Thread Starter
Member
Re: Program Crashing
I have tested this way.
It still crashes VB.
-
Aug 20th, 2008, 04:12 PM
#8
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.
-
Aug 21st, 2008, 07:30 AM
#9
Thread Starter
Member
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.
-
Aug 21st, 2008, 07:18 PM
#10
Thread Starter
Member
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
-
Aug 22nd, 2008, 08:55 AM
#11
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|