quote:Original post by Magmai Kai Holmlor
this is null or uninitialized
create the object before you use it...
Edited by - Magmai Kai Holmlor on January 1, 2002 4:46:29 PM
Yep, I think Magmai has it! He means the
this
pointer is null as in you did not create the object that your are calling init()
on.i.e.
GraphicsEngine *graphics = NULL;
graphics->init(directDraw);
The
GraphicsEngine
object has not been created so when your init()
method tries to assign a value to one of the class date members an exception is thrown as the program has tried to access an invalid memory location.Make sure you create the object before you use it.
i.e.
graphics = new GraphicsEngine()
and make sure you clean it up after you are finished with it:
delete graphics;
At least that seems like the problem, because there's no other reason that I can think of that an assignement would throw an exception.
EDIT:
- Kaijin
Edited by - Kaijin on January 3, 2002 8:43:00 AM