I am using MSVC++ 6 and VB 6 to test my dll.
>>Could you clarify this sentence. Are you saying that your program is using 200MB of memory?
No its not using so much memory, Because my program sometimes crahses it doesn't get a chance to delete my variables thus they are still in memory. I had 200mg left for storage.
this is my macrodefinition. It is the minimum to search for in memory;
#define STR_ADD 30
This next part is the initialization of the variable.
Code:
Text.string = new char[STR_ADD];
Text.count = STR_ADD;
Text.len = 2;
Text.string[0] = (char) 13;
Text.string[1] = (char) 10;
This is the part when I search for more memory. It is in a function and "by" is a variable of the amount to increase;
Code:
char *temp;
temp = new char[Text.count + by];
if(temp == NULL){msgbox("Out of Memory on While Resizing Text"); return OUT_OF_MEMORY;}
memcpy(temp, Text.string, Text.len +1); // move everything to new space
delete [] Text.string; // delete the old space
Text.string = temp; // assigne it to new space
Text.count = Text.count + by;
int put = Text.string - Lines.lpLines[0];
int i;
The only time the text size is resized is when there is more needed. If the user using my text editor deletes text, the text size is allocated for storage is not reallocated.
I pushed CTRL+ALT+DEL while my program was running and the "out of memory" message popuped up. I it was using up 3mg. Maby Iam not using a good method for allocating memory for text. Any Idea's are welcome,
Thanx in advance!