Board index » delphi » Please help - General Protection Fault in delphi 1

Please help - General Protection Fault in delphi 1

Can anyone HELP me PLEASE.

I am a student at uni of hertfordshire and i am developing a blackjack
program using Delphi v1.  

I am experiencing problems when I run the compiled program, as it soon
gives a GPF, this occurs when running under win 3.1 and win 95.  

It has been suggested to me that the cause could be due to errors in
allocating memory for the objects.  If this is the case what is the most
likely error/solution ?

Can anyone advise of any other possible reasons for this error?

Any advice would be most gratefully recieved.  Thankyou.  

th5aj(no-spam)@herts.ac.uk

To email me remove the (no-spam) from the above address.

 

Re:Please help - General Protection Fault in delphi 1


Quote
Hayler <th...@herts.ac.uk> wrote:

>It has been suggested to me that the cause could be due to errors in
>allocating memory for the objects.  If this is the case what is the most
>likely error/solution ?

You've probably messed up the pointer handling. You're either leaving
pointers dangling, or dereferencing NIL pointers. Remeber that when
you FREE an object, NONE of the pointers to it are set to NIL. You
have to do that manually.

Quote
>Can anyone advise of any other possible reasons for this error?

Sloppy coding? Have you turned on "Break on first exception" in the
Delphi IDE. This will show you exactly where they error occured, and
you will be able to examine the state of your program (globals,locals
etc etc)

PS. Greetings from one CompSci to another ... I did my final year
project in Delphi this year :-)

MH.

***********************************************
Martin Harvey
Pembroke College, Cambridge University.
Uni email: mc...@hermes.cam.ac.uk
Home email: mc...@harvey27.demon.co.uk
Web pages: http://www.harvey27.demon.co.uk
***********************************************

Other Threads