-
Wierd problem with vb
I'm running VB6 and for some reason whenever my program generates and error and I click the stop button VB closes down completly without saving changes... I lost like an hour's worth of work because when I get rolling I forget to save :/ Anyways I recoved the changes but this is still annoying. I've tried rebooting and that didn't solve the problem. I'm not sure why this has started so recently... has anyone encountered this problem?
-
You work an entire hour without saving!!!
(You can avoid that by setting your preferences or options or whatever it is to save everytime you run the program)
-
Yes I know it's a bad practice but I just get into a mode where I just don't notice the amount of work I've done until something like that happens...
Aye I did find this option but it still doesn't help the real problem of my editor crashing everytime I run into an error in my program
-
Ok, what kind of error. You get a VB msgbox that tells you the error and you have the choice to "debug"? If you do, what happens when you click "debug"?
(The pinky and ring finger of my left hand is on autopilot to use control-S to save whatever module I'm working on. It just does it by itself. Sometimes I have to slap it.)
-
Sub or function not define is the one I notice it on... but I wouldn't doubt if it happened to other errors
-
Check the your event viewer? Look at the task manager's performance tab, maybe you're running out of memory for some reason?
-
I've seen a virus at work that did the same thing your talking about, but it did it to MS Office stuff.
-
I'm running vb on a 1.4ghz with 512 DDR and nothing else running... It's not that. I've determined it's infact all errors, it just crashed on a next without For error.
I doubt it's a virus, I'm running Norton 2002 it just updated earlier today.
-
-
As I said in my first post that proved ineffective :/
-
Is this your problem?
http://support.microsoft.com/default...;en-us;Q138140
or maybe this
http://support.microsoft.com/default...;en-us;Q189156
The above link might be it--if you have things going on in your program that would cause VB to terminate if the program had to suddenly stop. What if you set a watch window up and trace what's happening with big time objects.
Search the knowledgebase some more at support.microsoft.com. Can you try it on another computer?
Sorry if my stabs are annoying. I'm shutting down for the night now, so this will be my last. No more dead ends from me tonight. Hope you solve your problem.
-
It's alright I know you're trying to help and I appriciate it... it doesn't seem either are the problem... it's a problem with the IDE not the program itself. When I start a program to test some thing if it encounters and error (ie. With statement without end with, etc) and I click the stop button the entire IDE shuts down for no reason whatsoever... I can stop a program that is in normal operation alright but when it encounters an error it crashes :/
-
Are you doing message hooking in the program?
-
-
Something like:
Code:
Public Sub Hook(hwnd As Long)
lngHWnd = hwnd
lpPrevWndProc = SetWindowLong(lngHWnd, GWL_WNDPROC, AddressOf WindowProc)
End Sub
-
hmmm well I am using some api calls and subclassing that Hack gave me earlier which allow me to change the forecolor of command buttons, SetButtonForecolor cmdLogin.hWnd, vbcyan in the form_load event but nowhere near where the error occurs.
-
Unfortunately it doesn't matter where the code is. When you do message hooking, unless you close the application gracefully, VB aborts. In other words you can't click the "End" button. If the message hooking is not critical while you are developing your program, you can do what I do and that is to temporarily turn it off. I do that by adding a Conditional Compilation Argument (in Project properties) called Testing which I set to 1 when I'm testing my program and 0 when I make my exe. I also have code in the program that looks like the following which only turns on the message hooking when I'm not testing.
Code:
#If Testing Then
' Don't hook
#Else
If TypeOf Controls(intIndex) Is TextBox Then
' Turn off the TextBox system right-click menu
Call Hook(Controls(intIndex).hwnd)
End If
#End If
-