Click to See Complete Forum and Search --> : Help on debugging general protection error
Evelyn Ong
Jan 26th, 2000, 02:35 PM
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?
rancor
Jan 26th, 2000, 05:41 PM
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.
Private Sub Form_Load()
On Error GoTo ErrorHandler
'the code
Exit Sub
ErrorHandler:
MsgBox Err.Number & " " & Err.Description, vbCritical
End Sub
------------------
Best Regards rancor
rancor@sajberhem.nu
http://www.sajberhem.nu
Aaron Young
Jan 26th, 2000, 09:19 PM
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
aarony@redwingsoftware.com
ajyoung@pressenter.com
Buzby
Jan 27th, 2000, 11:52 AM
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
BuzbyB@HotMail.Com
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.