Click here to Skip to main content
15,896,439 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Where can I get Visual C++ 1.5 ? Pin
NormDroid14-Nov-03 9:52
professionalNormDroid14-Nov-03 9:52 
AnswerRe: Where can I get Visual C++ 1.5 ? Pin
Ravi Bhavnani14-Nov-03 10:42
professionalRavi Bhavnani14-Nov-03 10:42 
AnswerRe: Where can I get Visual C++ 1.5 ? Pin
Cyrus Dang14-Nov-03 11:04
Cyrus Dang14-Nov-03 11:04 
GeneralRe: Where can I get Visual C++ 1.5 ? Pin
Tom Archer14-Nov-03 12:12
Tom Archer14-Nov-03 12:12 
GeneralRe: Where can I get Visual C++ 1.5 ? Pin
Cyrus Dang14-Nov-03 12:19
Cyrus Dang14-Nov-03 12:19 
GeneralRe: Where can I get Visual C++ 1.5 ? Pin
Tom Archer14-Nov-03 12:26
Tom Archer14-Nov-03 12:26 
GeneralRe: Where can I get Visual C++ 1.5 ? Pin
Anonymous14-Nov-03 13:39
Anonymous14-Nov-03 13:39 
GeneralAnother delete problem Pin
DougW4814-Nov-03 8:50
DougW4814-Nov-03 8:50 
I am having a similar problem as Keck (about 5 posts down). A few years ago I wrote some templated storage classes (Arrays, Linked Lists, Stacks, Queues) and I still use them all the time in applications, and I've never had problems with them working. Just recently I wrote a Table class which is basically an array of my templated Arrays. So my one private variable WAS defined as:

const static int SIZE = 100;
Array<T> * MyTable = new Array<T>[SIZE];

This worked perfectly, no errors, no memory leaks (as far as I could tell)...I never had a single problem with it. But I am using this same class to store various datatypes, and sometimes there are many items, sometimes only a few hundred...so I changed the wanted to be able to define SIZE instead of always using 100. So basically I didn't define MyTable in the declaration anymore, now I define it in the constructor. So my declaration is now:

Array<T> * MyTable;

and in the constructor:

MyTable = NULL;
MyTable = new Array<T>[WHATEVER_SIZE];

This still seems to work fine, but now my program is crashing when it hits the destructor from this Table class. This is all I have in the constructor:

if ( MyTable )
delete []MyTable;

The debugger won't show me a line where my program crashes, but if I comment out the contents of the destructor function, then my program will run through to finish...and never releases memory. I do get the following error when the program crashes:

Expression: _CrtIsValidHeapPointer(pUserData)

But I don't know exactly what this means. I hope I wasn't vague at all in my explanation of my problem, and I appreciate the help! Thanks a ton to everybody who responds!


I have never failed when programming. Instead I have succeeded in finding thousands of ways of crashing a computer!

Douglas A. Wright
dawrigh3@kent.edu
GeneralRe: Another delete problem Pin
DougW4814-Nov-03 8:57
DougW4814-Nov-03 8:57 
GeneralSound Please?! Pin
DaFrawg14-Nov-03 8:29
DaFrawg14-Nov-03 8:29 
GeneralRe: Sound Please?! Pin
basementman14-Nov-03 8:53
basementman14-Nov-03 8:53 
GeneralRe: Sound Please?! Pin
Alexander M.,14-Nov-03 22:39
Alexander M.,14-Nov-03 22:39 
GeneralRe: Sound Please?! Pin
DaFrawg16-Nov-03 10:19
DaFrawg16-Nov-03 10:19 
GeneralRe: Sound Please?! Pin
DaFrawg22-Nov-03 1:22
DaFrawg22-Nov-03 1:22 
GeneralDisplaying thumbnails Pin
harsh91114-Nov-03 8:20
harsh91114-Nov-03 8:20 
GeneralRe: Displaying thumbnails Pin
Maximilien14-Nov-03 8:47
Maximilien14-Nov-03 8:47 
GeneralRe: Displaying thumbnails Pin
Ryan_Roberts14-Nov-03 9:44
Ryan_Roberts14-Nov-03 9:44 
GeneralRe: Displaying thumbnails Pin
Michael Gunlock15-Nov-03 14:00
Michael Gunlock15-Nov-03 14:00 
QuestionRight way to size a control to fit window? Pin
Kuniva14-Nov-03 8:14
Kuniva14-Nov-03 8:14 
AnswerRe: Right way to size a control to fit window? Pin
Peter Molnar14-Nov-03 14:02
Peter Molnar14-Nov-03 14:02 
GeneralKeyboard Hook Pin
trendb14-Nov-03 8:09
trendb14-Nov-03 8:09 
GeneralRe: Keyboard Hook Pin
JWood14-Nov-03 9:41
JWood14-Nov-03 9:41 
GeneralRe: Keyboard Hook Pin
trendb14-Nov-03 13:51
trendb14-Nov-03 13:51 
GeneralRe: Keyboard Hook Pin
Alexander M.,14-Nov-03 22:43
Alexander M.,14-Nov-03 22:43 
GeneralCreate a circling text around the button Pin
nhanquy8314-Nov-03 7:42
nhanquy8314-Nov-03 7:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.