Valhalla Legends Archive

Programming => General Programming => Topic started by: Antarctica on November 23, 2007, 05:26 PM

Title: VB6 Crashes when exiting app
Post by: Antarctica on November 23, 2007, 05:26 PM
I'm having quite a weird problem.  With my project, when I run it, then close it out, vb6 locks up and i have to crash it.  Anyone heard of this?

It only seems to happen when the Form design window is open.
Title: Re: VB6 Crashes when exiting app
Post by: Barabajagal on November 23, 2007, 05:48 PM
1) Are you using "End"?
2) Are you using the INet (Microsoft Internet Transfer) control?
3) Are you using subclassing?
Title: Re: VB6 Crashes when exiting app
Post by: Antarctica on November 23, 2007, 05:51 PM
1: Yes, on both Form_Unload and Form_Terminate
2: No
3: Please explain what this means (sorry for being newb)
Title: Re: VB6 Crashes when exiting app
Post by: Barabajagal on November 23, 2007, 05:56 PM
Never, EVER use End. It is the absolute worst thing you can do. Remove it immediately.

Subclassing is where you write code that goes before the built in system message handling in VB. It can be used in a variety of ways to intercept or send messages to or from applications. For instance, you can hook WM_MMI, which is the system message for resizing windows, to prevent a window from getting smaller or larger than defined values.
Title: Re: VB6 Crashes when exiting app
Post by: Antarctica on November 23, 2007, 05:57 PM
No, I don't remember doing anything fancy like that  :-\
Title: Re: VB6 Crashes when exiting app
Post by: Barabajagal on November 23, 2007, 06:00 PM
Well, get rid of End in both instances. When you need to close a window, use Unload Me. When you need to close all the windows, use a For Each loop, like so:


Dim Frm as Form
    For Each Frm in Forms
        Unload Frm
    Next Frm
Title: Re: VB6 Crashes when exiting app
Post by: brew on November 23, 2007, 06:20 PM
Are you using a winsock control, and using a text IP? (such as, valhallalegends.com)
Doing this, then trying to close it may "hang" vb6 for a while then crash. I have this problem.
Title: Re: VB6 Crashes when exiting app
Post by: Antarctica on November 23, 2007, 06:27 PM
Yeah, i am using useast.battle.net
Title: Re: VB6 Crashes when exiting app
Post by: brew on November 23, 2007, 06:40 PM
I guess that's your problem. It happens to about what seems like every 1/9 people who use vb6, including me. I know of no way to fix that. Just revolve it yourself, by using gethostbyname (http://msdn2.microsoft.com/en-us/library/ms738524.aspx).
Title: Re: VB6 Crashes when exiting app
Post by: vuther.de on November 23, 2007, 11:13 PM
I know how you feel about VB6 always freezing or crashing. It made me so mad. I never could find out why it did that until my later years of programming.
Title: Re: VB6 Crashes when exiting app
Post by: Hell-Lord on November 24, 2007, 04:27 AM
Quote from: Andy on November 23, 2007, 06:00 PM
Well, get rid of End in both instances. When you need to close a window, use Unload Me. When you need to close all the windows, use a For Each loop, like so:


Dim Frm as Form
    For Each Frm in Forms
        Unload Frm
    Next Frm


Dim frm as Form
For Each frm In Forms
Unload frm
Set frm = Nothing
Next

fixed ;)
Title: Re: VB6 Crashes when exiting app
Post by: Dale on November 24, 2007, 11:47 AM
Make sure on Form_Terminate and Form_Close and stuff, you do wSck.Close because, if I don't, then usually I'll freeze up as well.
Title: Re: VB6 Crashes when exiting app
Post by: Hell-Lord on November 24, 2007, 05:48 PM
I find QueryUnload good to use too, it is fired before the terminate and unload events and allows the user to specify what to do when a particular method has been used to close the applications.

Private Sub Form_QueryUnload(Cancel As Integer, _
UnloadMode As Integer)
Select Case UnloadMode
Case 0:
' User used the 'X' in the corner to close
' the application
Case 1:
' Some other code within this application is invoked
' and is closing the application.
Case 2:
' Windows session is closing (i.e. Start, Shut Down)
Case 3:
' Task Manager is closing this application. (i.e.
' Ctrl+Alt+Del, End Task)
Case 4:
' The MDI parent form is closing.
End Select
End Sub


And yes you should do what Dale said if the Winsock is not already closed.
Title: Re: VB6 Crashes when exiting app
Post by: Warrior on November 25, 2007, 06:19 PM
Quote from: inner.de on November 23, 2007, 11:13 PM
I know how you feel about VB6 always freezing or crashing. It made me so mad. I never could find out why it did that until my later years of programming.

The problem is you were using VB6 after years of programming.
Title: Re: VB6 Crashes when exiting app
Post by: Dale on November 25, 2007, 07:42 PM
Quote from: Warrior on November 25, 2007, 06:19 PM
Quote from: inner.de on November 23, 2007, 11:13 PM
I know how you feel about VB6 always freezing or crashing. It made me so mad. I never could find out why it did that until my later years of programming.

The problem is you were using VB6 after years of programming.

Trolling much? :-\
Title: Re: VB6 Crashes when exiting app
Post by: brew on November 25, 2007, 07:47 PM
Quote from: Dale on November 25, 2007, 07:42 PM
Quote from: Warrior on November 25, 2007, 06:19 PM
Quote from: inner.de on November 23, 2007, 11:13 PM
I know how you feel about VB6 always freezing or crashing. It made me so mad. I never could find out why it did that until my later years of programming.

The problem is you were using VB6 after years of programming.

Trolling much? :-\
Isn't trolling where you supply false information in order to confuse the OP and/or create some kind of controversy? I wouldn't say warrior is trolling. I agree with his statement 100%.
Title: Re: VB6 Crashes when exiting app
Post by: Banana fanna fo fanna on November 25, 2007, 08:35 PM
i think it's just flamebait
Title: Re: VB6 Crashes when exiting app
Post by: vuther.de on November 25, 2007, 08:38 PM
I don't take that as a flame to me, mostly because what he said flames VB. But the reason why I didn't move on was because programming was just a hobby, I didn't plan to educate myself further.
Title: Re: VB6 Crashes when exiting app
Post by: Warrior on November 25, 2007, 08:42 PM
It was more of a joke, ironically I've never trolled these boards though I have been banned from here for allegedly trolling. Go figure :).

Title: Re: VB6 Crashes when exiting app
Post by: Dale on November 26, 2007, 03:11 PM
I wasn't picking on you Warrior, It was just kind of hard to tell how you were saying it. :P
Title: Re: VB6 Crashes when exiting app
Post by: Mystical on November 26, 2007, 04:12 PM
Another reason why visual basic 6 may crash could be from a internal usercontrol; which they have never fixed to unload right. ;p
Title: Re: VB6 Crashes when exiting app
Post by: Barabajagal on November 27, 2007, 02:20 PM
Never had an app of mine crash because of a UserControl.
Title: Re: VB6 Crashes when exiting app
Post by: Dale on November 27, 2007, 08:40 PM
Maybe because your User Controls were coded correctly? ???
Title: Re: VB6 Crashes when exiting app
Post by: Barabajagal on November 27, 2007, 08:48 PM
Naw, a few of them do the "BROKEN" thing all the time, where the control gets diagonal lines all across it. Maybe it's because I'm using Service Pack 6?
Title: Re: VB6 Crashes when exiting app
Post by: Dale on November 28, 2007, 07:47 PM
Hello, Windows sucks period.
Title: Re: VB6 Crashes when exiting app
Post by: Kp on November 28, 2007, 10:02 PM
Quote from: Dale on November 28, 2007, 07:47 PM
Hello, Windows sucks period.

Windows is a sufficiently large construct that such a sweeping generalization is inappropriate.  Some of Microsoft's offerings shipped with Windows do indeed suck, but there are parts that are decent.
Title: Re: VB6 Crashes when exiting app
Post by: Dale on November 29, 2007, 08:13 AM
Quote from: Kp on November 28, 2007, 10:02 PM
Quote from: Dale on November 28, 2007, 07:47 PM
Hello, Windows sucks period.

Windows is a sufficiently large construct that such a sweeping generalization is inappropriate.  Some of Microsoft's offerings shipped with Windows do indeed suck, but there are parts that are decent.

It didn't use to be bad, it use to be efficient, but ever since Windows Vista hit the market, my view for Microsoft declined.
Title: Re: VB6 Crashes when exiting app
Post by: Banana fanna fo fanna on November 29, 2007, 03:26 PM
fucking overlapped i/o is sweet.
Title: Re: VB6 Crashes when exiting app
Post by: Warrior on November 29, 2007, 05:54 PM
Quote from: Dale on November 29, 2007, 08:13 AM
Quote from: Kp on November 28, 2007, 10:02 PM
Quote from: Dale on November 28, 2007, 07:47 PM
Hello, Windows sucks period.

Windows is a sufficiently large construct that such a sweeping generalization is inappropriate.  Some of Microsoft's offerings shipped with Windows do indeed suck, but there are parts that are decent.

It didn't use to be bad, it use to be efficient, but ever since Windows Vista hit the market, my view for Microsoft declined.

Ironic considering your signature sports the Windows Vista color scheme and the login screen wallpaper.
Title: Re: VB6 Crashes when exiting app
Post by: Barabajagal on November 29, 2007, 07:04 PM
Win2k Pro FTW!
Title: Re: VB6 Crashes when exiting app
Post by: Dale on November 30, 2007, 06:05 AM
Quote from: Warrior on November 29, 2007, 05:54 PM
Quote from: Dale on November 29, 2007, 08:13 AM
Quote from: Kp on November 28, 2007, 10:02 PM
Quote from: Dale on November 28, 2007, 07:47 PM
Hello, Windows sucks period.

Windows is a sufficiently large construct that such a sweeping generalization is inappropriate.  Some of Microsoft's offerings shipped with Windows do indeed suck, but there are parts that are decent.

It didn't use to be bad, it use to be efficient, but ever since Windows Vista hit the market, my view for Microsoft declined.

Ironic considering your signature sports the Windows Vista color scheme and the login screen wallpaper.


Never said I didn't care for the GUI, It's cute, but as far as performance wise it's shit.
Title: Re: VB6 Crashes when exiting app
Post by: MyndFyre on November 30, 2007, 11:05 AM
Bull.  Shit.
Title: Re: VB6 Crashes when exiting app
Post by: Barabajagal on November 30, 2007, 02:30 PM
Eww... the GUI looks like a shitty knock-off of OSX, which is what it is!
Title: Re: VB6 Crashes when exiting app
Post by: Dale on November 30, 2007, 03:56 PM
I like it, but like I said despite MyndFyres' comment, performance is shit.
Title: Re: VB6 Crashes when exiting app
Post by: Warrior on November 30, 2007, 04:10 PM
Quote from: Dale on November 30, 2007, 06:05 AM
Quote from: Warrior on November 29, 2007, 05:54 PM
Quote from: Dale on November 29, 2007, 08:13 AM
Quote from: Kp on November 28, 2007, 10:02 PM
Quote from: Dale on November 28, 2007, 07:47 PM
Hello, Windows sucks period.

Windows is a sufficiently large construct that such a sweeping generalization is inappropriate.  Some of Microsoft's offerings shipped with Windows do indeed suck, but there are parts that are decent.

It didn't use to be bad, it use to be efficient, but ever since Windows Vista hit the market, my view for Microsoft declined.

Ironic considering your signature sports the Windows Vista color scheme and the login screen wallpaper.


Never said I didn't care for the GUI, It's cute, but as far as performance wise it's shit.

Performs just fine for me, and I've had it since release. What specifically is slow for you?
Title: Re: VB6 Crashes when exiting app
Post by: Warrior on November 30, 2007, 04:13 PM
Quote from: Andy on November 30, 2007, 02:30 PM
Eww... the GUI looks like a shitty knock-off of OSX, which is what it is!

Except Aero and it's underlying technologies were being shown off at PDCs before OSX got any form of usable compositing+3D Effects.

Additionally, if you find think that a Windows Vista Desktop, and an OSX Desktop look in any way similar you must be smoking something.

Or maybe we should mention how Leopard adopts the Vista Style translucent Menu Bar? Nah.
Title: Re: VB6 Crashes when exiting app
Post by: Barabajagal on November 30, 2007, 04:19 PM
It's the entire idea of the round/bubbly/glassy/"Web2.0" shit. I can't stand any of it. I like dark, squared off interfaces that don't make me feel like I'm playing a game designed for a three year old.
Title: Re: VB6 Crashes when exiting app
Post by: brew on November 30, 2007, 05:27 PM
Quote from: Andy on November 30, 2007, 04:19 PM
It's the entire idea of the round/bubbly/glassy/"Web2.0" shit. I can't stand any of it. I like dark, squared off interfaces that don't make me feel like I'm playing a game designed for a three year old.
But that's the future of computing! Great, init?
Title: Re: VB6 Crashes when exiting app
Post by: Dale on December 01, 2007, 10:22 AM
You have awful taste Andy,  :P
Title: Re: VB6 Crashes when exiting app
Post by: Barabajagal on December 01, 2007, 03:40 PM
I value ease of use over appearance. Visual styles should be minimal, un-noticed, and not distracting. Windows XP's "Luna" skin was completely and totally pointless. It didn't increase productivity at all. In fact, it made lots of things larger than they needed to be, which takes up workspace. Aero's even worse. It's all bloated, pointless bullshit. I'd rather use a text based system that lets me work without a single thought to the GUI.
Title: Re: VB6 Crashes when exiting app
Post by: brew on December 01, 2007, 07:34 PM
Quote from: Andy on December 01, 2007, 03:40 PM
I'd rather use a text based system that lets me work without a single thought to the GUI.
See: Ripple Chat Bot Configuration GUI
Title: Re: VB6 Crashes when exiting app
Post by: Dale on December 01, 2007, 10:09 PM
Quote from: brew on December 01, 2007, 07:34 PM
Quote from: Andy on December 01, 2007, 03:40 PM
I'd rather use a text based system that lets me work without a single thought to the GUI.
See: Ripple Chat Bot Configuration GUI

It was rather repulsive.
Title: Re: VB6 Crashes when exiting app
Post by: Camel on December 02, 2007, 05:47 AM
It's pointless to argue over who did what first. Even if the information you use to support your argument is fact, it still doesn't change the bottom line: Aero is egregiously slow.

I've seen benchmarks, supported by my own personal experience, that indicate Aero is responsible for as much as a 150% slowdown in window draw time when compared to the classic windows style. If you've got a top of the line computer with a top of the line graphics card, you probably wont notice the difference, but I for one will not be installing Vista any time soon.

Leopard runs just fine on my MacBook. I've got the GM850 graphics card (it's a shitty integrated Intel card), and it has no problems drawing any of the effects in OSX.
Title: Re: VB6 Crashes when exiting app
Post by: warz on December 02, 2007, 06:49 PM
So, you can't run Vista with Aero - who cares?
Title: Re: VB6 Crashes when exiting app
Post by: MyndFyre on December 02, 2007, 08:16 PM
Quote from: Camel on December 02, 2007, 05:47 AM
Leopard runs just fine on my MacBook.
I'm sure Windows would run with flying colors on a machine in which Microsoft had all the control over the hardware, too.  ::)
Title: Re: VB6 Crashes when exiting app
Post by: Barabajagal on December 02, 2007, 08:28 PM
Actually, I'd be very much afraid of hardware controlled completely by a Microsoft product...
Title: Re: VB6 Crashes when exiting app
Post by: MyndFyre on December 02, 2007, 09:13 PM
Quote from: Andy on December 02, 2007, 08:28 PM
Actually, I'd be very much afraid of hardware controlled completely by a Microsoft product...
That's entirely irrelevant to what I just said.
Title: Re: VB6 Crashes when exiting app
Post by: Barabajagal on December 02, 2007, 09:19 PM
Yes, and everything the last few pages has been talking about has been irrelevant to the topic.
Title: Re: VB6 Crashes when exiting app
Post by: Dale on December 03, 2007, 09:11 AM
Quote from: Andy on December 02, 2007, 09:19 PM
Yes, and everything the last few pages has been talking about has been irrelevant to the topic.

Not necessarily, the fact that Microsoft Window sucks, may be the problem to Visual Basic crashing?
Title: Re: VB6 Crashes when exiting app
Post by: Banana fanna fo fanna on December 03, 2007, 10:13 AM
the general software bloat trend is disgusting, scary, and a conspiracy. the only good thing that has come from software bloat is VM languages.
Title: Re: VB6 Crashes when exiting app
Post by: Warrior on December 03, 2007, 01:33 PM
Quote from: Camel on December 02, 2007, 05:47 AM
It's pointless to argue over who did what first. Even if the information you use to support your argument is fact, it still doesn't change the bottom line: Aero is egregiously slow.

I've seen benchmarks, supported by my own personal experience, that indicate Aero is responsible for as much as a 150% slowdown in window draw time when compared to the classic windows style. If you've got a top of the line computer with a top of the line graphics card, you probably wont notice the difference, but I for one will not be installing Vista any time soon.

Leopard runs just fine on my MacBook. I've got the GM850 graphics card (it's a shitty integrated Intel card), and it has no problems drawing any of the effects in OSX.

I think Myndy hit the nail on the head, when Apple controls the hardware and the software it's very easy to optimize the system for performance.

There are various trade offs, assumptions, etc made when handling with such a wide array of hardware. Aero takes advantage of modern hardware, so OEMs are going to have to step up their game and give people quality parts.

It pushes the envelope on the evolution of that specific field of technology, so it can't all be a bad thing.

Even so, there's no doubt in my mind with all this taken into account that Aero is still a hog. It's a 1.0 technology, and I know for a fact that the compositor in OSX was not as fast as it is today, the day it was released.