Thanks to the help from all you lovely people on my last problem I've managed to crack on and make my program work the way I wanted.
For a quick catchup: I have a program that creates objects on the fly with new every time a certain event happens, and stores the memory locations of these new objects in a database as an integer value. I can then interact with any specific object by converting the integer value back into a pointer. All this is working brilliantly!
However, when the object is destroyed using delete on that pointer, the destructor is called and executes all it's code correctly, then the program crashes. My compiler (Visual C++ Express) throws a message saying No Source Available with "Call stack location: Table::`scalar deleting destructor'() + 0x2b bytes".
Am I doing something wrong by calling delete on a pointer to the object?
Relevant code below. I have omitted all the database query code:
unsigned long tablename;
// this variable holds the memory location (in integer form)
// of a specific object, retrieved from the database.
Table* tableptr; // pointer of class type
tableptr = (Table*)tablename;
// destructor is called correctly
// more database interaction code which completes successfully