|
If you have Windows 2000 or XP, look at the Performance tab of Task Manager to see the machine's memory usage. What does it look like before and during the program's execution?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
|
Which makes no sense. Look at the Task Manager before your program runs, write down the memory-related numbers. Look at the Task Manager while your program runs, write down the memory-related numbers. Compare those numbers. What do they tell you?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
That i've got plenty of memory left...
|
|
|
|
|
Ok, can you post the exact verbiage of the out-of-memory message?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
It comes in a messagebox:
Unhandled exception at 0x77e73887 in net32.exe: Microsoft C++ exception: CMemoryException @ 0x00f5f3a4.
|
|
|
|
|
Sounds like you need to compile in debug mode, and use F5 to start the program.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
What I meant was are you allocation memory to data statically or dynamically.
i.e.
char data[1000000];
or
char* pdata;
pdata = new char[1000000];
delete [] pdata;
If you are running through the debugger you should be able to see what it is that is failing to allocate. If you look at the call stack, what is being called?
Ant.
|
|
|
|
|
It's a malloc call. Trying to allocate 22 bytes..
|
|
|
|
|
If this is a C++ program use new /delete instead.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
When you look at the call stack is it calling the same function over and over again?
I.e. trying to allocate 22bytes over and over again?
Ant.
|
|
|
|
|
You may have corrupted the heap.
Usually this is because you've written to an uninitialized pointer, or written before/beyong the end of an array or object that you've previously allocated on the heap.
|
|
|
|
|
How may I change the default color in my CDialog with all my cildren-windows ( CButtons, CTabCtrl, … )
...and justice for all
APe
|
|
|
|
|
perhaps the is a better way, but i would subclass all objects
and overwrite the wm_ctlcolor method of each object
|
|
|
|
|
OK!! Thanks
Any suggestion how to make my dlg RGB(255,0,0) ?
...and justice for all
APe
|
|
|
|
|
for example:
HBRUSH CCtlcoloDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
CBrush *brush = new CBrush(HS_BDIAGONAL,RGB(200,0,0));
return (HBRUSH)(brush->GetSafeHandle());
}
i would declare and construct the brush outside the OnCtlColor Method
|
|
|
|
|
You're the King and made my Day - Thanks
...and justice for all
APe
|
|
|
|
|
How do I write a function that has a variable number of parameters. Ideally I would like the first parameter to be an integer, and then that number of parameters must be entered.
For example
function(5,1,2,3,4,5)
or
function(3,1,2,3)
Thanks
|
|
|
|
|
for variable no. of arguments use va_arg, look into MSDN for more details
|
|
|
|
|
return_type fonction (...); the '...' is the C style to say that th function can have a variable number of parameters.
if you want fixed parameters, with a variable list below , do this (printf() function for example):
<font style="color:blue;">int</font> printf(<font style="color:blue;">const char</font>*, ...);
To access such parameters, use the macros va_start (), va_arg () and va_end (), plus the va_list type.
TOXCCT >>> GEII power
|
|
|
|
|
In this particular case:
int function( int nParams, ... ); and then use va_list :
int function( int nParams, ... )
{
int argValue;
va_list args;
va_start( args, nParams );
for ( int nParam = 0; nParam < nParams; ++nParam )
{
argValue = va_arg( args, int );
}
}
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Is there any wizard to add massege map for toolbar items in the IDE of VS .NET?
There are only menu commands in property view.
|
|
|
|
|
Hi
In my property sheet, i disabled all default property sheet buttons. Now i want to add my own buttons to Property sheet. How to implement this?
Thanks
JP
ALL THINGS ARE POSSIBLE UNTIL THEY ARE PROVED IMPOSSIBLE-AND EVEN THE IMPOSSIBLE MAY ONLY BE SO,AS OF NOW
|
|
|
|
|
There is no easy way - you will have to add it one-be-one, after getting pointer to sheet window itself. I have not used it for a long time, but probably you have to do it from OnInitDialog.
I'm using my own class, which is dialog based (so you use template for it), and handles switches of pages. Here is screenshot of typical complex dialog example, using this approach: http://www.grigsoft.com/ws000.gif[^]. If somebody is interested, I could probably post an article on CP about it - I will just clean up the code a bit.
Igor Green
http://www.grigsoft.com/ - files and folders comparison tools
|
|
|
|
|
Is there any meaning in setting baud rate to virtual serial ports ? Do they really work?
|
|
|
|