Results 1 to 18 of 18

Thread: Wierd problem with vb

  1. #1

    Thread Starter
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668

    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.

  2. #2
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    NY
    Posts
    497
    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)
    end war
    stop greed

  3. #3

    Thread Starter
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668
    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.

  4. #4
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    NY
    Posts
    497
    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.)
    end war
    stop greed

  5. #5

    Thread Starter
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668
    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.

  6. #6
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    NY
    Posts
    497
    Check the your event viewer? Look at the task manager's performance tab, maybe you're running out of memory for some reason?
    end war
    stop greed

  7. #7
    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...

  8. #8

    Thread Starter
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668
    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.

  9. #9
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    NY
    Posts
    497
    time to reboot?
    end war
    stop greed

  10. #10

    Thread Starter
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668
    As I said in my first post that proved ineffective :/
    If wishes were fishes we'd all cast nets.

  11. #11
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    NY
    Posts
    497
    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.
    end war
    stop greed

  12. #12

    Thread Starter
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668
    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.

  13. #13

  14. #14

    Thread Starter
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668
    What is message hooking?
    If wishes were fishes we'd all cast nets.

  15. #15

  16. #16

    Thread Starter
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668
    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.

  17. #17
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    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

  18. #18

    Thread Starter
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668
    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
  •  



Click Here to Expand Forum to Full Width