|
-
Feb 22nd, 2002, 08:15 PM
#1
Thread Starter
Fanatic Member
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?
If wishes were fishes we'd all cast nets.
-
Feb 22nd, 2002, 08:21 PM
#2
Hyperactive Member
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)
-
Feb 22nd, 2002, 08:24 PM
#3
Thread Starter
Fanatic Member
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
If wishes were fishes we'd all cast nets.
-
Feb 22nd, 2002, 08:28 PM
#4
Hyperactive Member
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.)
-
Feb 22nd, 2002, 08:45 PM
#5
Thread Starter
Fanatic Member
Sub or function not define is the one I notice it on... but I wouldn't doubt if it happened to other errors
If wishes were fishes we'd all cast nets.
-
Feb 22nd, 2002, 09:21 PM
#6
Hyperactive Member
Check the your event viewer? Look at the task manager's performance tab, maybe you're running out of memory for some reason?
-
Feb 22nd, 2002, 09:32 PM
#7
Member
I've seen a virus at work that did the same thing your talking about, but it did it to MS Office stuff.
I have a silent visitor.
I killed him with my hands, you know.
I killed him with my hands...
-
Feb 22nd, 2002, 09:34 PM
#8
Thread Starter
Fanatic Member
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.
If wishes were fishes we'd all cast nets.
-
Feb 22nd, 2002, 09:42 PM
#9
Hyperactive Member
-
Feb 22nd, 2002, 09:44 PM
#10
Thread Starter
Fanatic Member
As I said in my first post that proved ineffective :/
If wishes were fishes we'd all cast nets.
-
Feb 22nd, 2002, 10:00 PM
#11
Hyperactive Member
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.
-
Feb 22nd, 2002, 10:12 PM
#12
Thread Starter
Fanatic Member
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 :/
If wishes were fishes we'd all cast nets.
-
Feb 22nd, 2002, 10:30 PM
#13
Are you doing message hooking in the program?
-
Feb 22nd, 2002, 10:31 PM
#14
Thread Starter
Fanatic Member
If wishes were fishes we'd all cast nets.
-
Feb 22nd, 2002, 10:48 PM
#15
Something like:
Code:
Public Sub Hook(hwnd As Long)
lngHWnd = hwnd
lpPrevWndProc = SetWindowLong(lngHWnd, GWL_WNDPROC, AddressOf WindowProc)
End Sub
-
Feb 22nd, 2002, 10:51 PM
#16
Thread Starter
Fanatic Member
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.
If wishes were fishes we'd all cast nets.
-
Feb 23rd, 2002, 11:34 AM
#17
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
-
Feb 23rd, 2002, 05:23 PM
#18
Thread Starter
Fanatic Member
Ok thanks
If wishes were fishes we'd all cast nets.
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
|