LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

I met general protection error

Hi everyone:
I met general protection error when i programmed today. my program load data records from database file(.mdb file) to a two dimentional array. I declared the datatype in database file as memo, because i have a very long record. I also declared my array long enough to hold the long record, but still a general protection error happen.  
0 Kudos
Message 1 of 2
(3,155 Views)
Schoolworkwork -

Your program may be trying to directly or indirectly reference a memory location outside your program's address space.

Are you running in debug mode?  CVI's debug mode will catch bad references (e.g., referencing beyond an array bound) and lets you localize the problem. 

You get a GPF when your program misbehaves and there's no logic in the program to handle an exception (such as a bad memory reference).  The CVI development environment in debug mode should catch any Windows exception raised and give you a CVI popup with info on the nature of the problem.  If you're in release mode, CVI doesn't catch the exception, and the exception hits the OS and it aborts your program.

So try running with a debug build (even if you run the debug build directly, without the CVI IDE) and see if you get a different popup that tells you specfics about the problem.

Menchar






0 Kudos
Message 2 of 2
(3,144 Views)