Results 1 to 4 of 4

Thread: Help on debugging general protection error

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Location
    Singapore
    Posts
    1

    Post

    Hi,

    I edited the screens of program A recently to produce program X.

    However, when I compiled and installed X, certain functions in the program will produce a general protection error, thus terminating the program.

    But if I were to install the original program A in the same machine, on top of X, X will work!

    I suspect it has to do with the system files. But I'm not a VB person and I have to debug this.

    Can someone please help and advise me?
    How can I solve the problem?


  2. #2
    Lively Member
    Join Date
    May 1999
    Posts
    100

    Post

    eh.. You can always use error traps..
    Put this code where an error may be. Always use the "On Error..." on the top and don't forget to use Exit Sub in the end of the code because you don't want to execute the msgbox if everything is OK.

    Code:
    Private Sub Form_Load()
        On Error GoTo ErrorHandler
        'the code
        Exit Sub
        
    ErrorHandler:
        MsgBox Err.Number & " " & Err.Description, vbCritical
    End Sub
    ------------------
    Best Regards rancor
    [email protected]
    http://www.sajberhem.nu

  3. #3
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    Use a Packaging Wizard, ie. Package & Deployment Wizard in VB6 or Setup Wizard to create the Files you need to install your Application on a new PC, this will make sure you include all files neccessary to run your Application.

    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]


  4. #4
    Frenzied Member Buzby's Avatar
    Join Date
    Jan 1999
    Location
    UK
    Posts
    1,670

    Post

    Click on DETAILS when you get the error - this may give you a clue as to what component is causing the problem. You may find that you have removed or changed a control on the form in question and this is causing the problem.
    If the problem component is still on the form try deleting it and creating another one (call it the same name as the original and all the events etc will still link to it).
    Make sure you note the properties set on the original component first though.


    ------------------
    Mark "Buzby" Beeton
    VB Developer
    [email protected]



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