Click here to Skip to main content
15,888,239 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How do you get Vc6 apps to look themed in Vc8? Pin
Swinefeaster27-Jan-06 10:44
Swinefeaster27-Jan-06 10:44 
GeneralRe: How do you get Vc6 apps to look themed in Vc8? Pin
Jack Puppy27-Jan-06 13:25
Jack Puppy27-Jan-06 13:25 
GeneralRe: How do you get Vc6 apps to look themed in Vc8? Pin
Prakash Nadar27-Jan-06 22:37
Prakash Nadar27-Jan-06 22:37 
GeneralRe: How do you get Vc6 apps to look themed in Vc8? Pin
Swinefeaster3-Feb-06 8:10
Swinefeaster3-Feb-06 8:10 
QuestionHow to find total memory a process is using? Pin
sysop@HAL9K.com27-Jan-06 5:27
sysop@HAL9K.com27-Jan-06 5:27 
AnswerRe: How to find total memory a process is using? Pin
Toby Opferman27-Jan-06 7:20
Toby Opferman27-Jan-06 7:20 
GeneralRe: How to find total memory a process is using? Pin
Toby Opferman27-Jan-06 7:39
Toby Opferman27-Jan-06 7:39 
AnswerRe: How to find total memory a process is using? Pin
sysop@HAL9K.com27-Jan-06 9:24
sysop@HAL9K.com27-Jan-06 9:24 
Thanks Toby! There's still too much instrumentation for our simple needs. Here is what made the boss happy:

C:\Temp>printmemorystats.exe
total used 5054, free 760
OK - end of heap
total used 10174, free 3816
OK - end of heap
total used 12222, free 1760
OK - end of heap
total used 16318, free 5848
OK - end of heap
total used 24510, free 9936
OK - end of heap
total used 40894, free 14024
OK - end of heap
total used 73662, free 22128
OK - end of heap
total used 139198, free 26216
OK - end of heap
total used 270270, free 30304
OK - end of heap
total used 532414, free 34392
OK - end of heap


<code>#include <malloc.h>
#include <stdio.h>

static void PrintMemoryStats();

int main()
{
int sizemem=1024;
int ii;
char *foo;
for (ii=0; ii<10; ii++) {
PrintMemoryStats();
foo = malloc(sizemem);
sizemem *= 2;
}


}



static void PrintMemoryStats()
{
_HEAPINFO hinfo;
int heapstatus;
long totalUsed = 0, totalFree = 0;
hinfo._pentry = NULL;
while( ( heapstatus = _heapwalk( &hinfo ) ) == _HEAPOK )
{
if (hinfo._useflag == _USEDENTRY)
totalUsed += hinfo._size;
else if (hinfo._useflag == _FREEENTRY)
totalFree += hinfo._size;
}


printf ("total used %ld, free %ld\n", totalUsed, totalFree);
switch( heapstatus )
{
case _HEAPEMPTY:
printf( "OK - empty heap\n" );
break;
case _HEAPEND:
printf( "OK - end of heap\n" );
break;
case _HEAPBADPTR:
printf( "ERROR - bad pointer to heap\n" );
break;
case _HEAPBADBEGIN:
printf( "ERROR - bad start of heap\n" );
break;
case _HEAPBADNODE:
printf( "ERROR - bad node in heap\n" );
break;
}
}
</code>


-- modified at 15:25 Friday 27th January, 2006</code>
AnswerRe: How to find total memory a process is using? Pin
David Crow27-Jan-06 9:39
David Crow27-Jan-06 9:39 
Question"choose color" combobox Pin
xyhan27-Jan-06 5:24
xyhan27-Jan-06 5:24 
AnswerRe: "choose color" combobox Pin
Graham Bradshaw27-Jan-06 5:36
Graham Bradshaw27-Jan-06 5:36 
AnswerRe: "choose color" combobox Pin
David Crow27-Jan-06 9:41
David Crow27-Jan-06 9:41 
Questionhttp://www.codeproject.com/listctrl/liwne.asp Pin
hanno2527-Jan-06 4:48
hanno2527-Jan-06 4:48 
AnswerRe: http://www.codeproject.com/listctrl/liwne.asp Pin
benjymous27-Jan-06 5:41
benjymous27-Jan-06 5:41 
QuestionInheritance question Pin
act_x27-Jan-06 4:39
act_x27-Jan-06 4:39 
QuestionRe: Inheritance question Pin
David Crow27-Jan-06 5:10
David Crow27-Jan-06 5:10 
AnswerRe: Inheritance question Pin
Maximilien27-Jan-06 5:12
Maximilien27-Jan-06 5:12 
AnswerRe: Inheritance question Pin
ddmcr27-Jan-06 7:41
ddmcr27-Jan-06 7:41 
QuestionPassing a 2 dimension array created with new Pin
fleetmanager27-Jan-06 4:32
fleetmanager27-Jan-06 4:32 
QuestionRe: Passing a 2 dimension array created with new Pin
David Crow27-Jan-06 9:45
David Crow27-Jan-06 9:45 
QuestionAuto Enable Menu for dialog. Pin
includeh1027-Jan-06 4:02
includeh1027-Jan-06 4:02 
AnswerRe: Auto Enable Menu for dialog. Pin
Maximilien27-Jan-06 4:56
Maximilien27-Jan-06 4:56 
QuestionYour comments for monitoring users Pin
includeh1027-Jan-06 4:00
includeh1027-Jan-06 4:00 
AnswerRe: Your comments for monitoring users Pin
David Crow27-Jan-06 4:36
David Crow27-Jan-06 4:36 
AnswerRe: Your comments for monitoring users Pin
Maximilien27-Jan-06 7:12
Maximilien27-Jan-06 7:12 

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.