Well this code is written using win32++ as I don't have access to a mfc enabled copy of VS, but I'd (foolishly?) assume that it would work just the same in either case.
The code I posted will decrease the size(height) of the window, while increasing the size(height) of the non-client area.
The header will respond in just the same way as the non-client area for a tree control normally will. The window proc for this control only handles WM_NCCALCSIZE and WM_NCPAINT messages, passing any others to the original wind proc.
Here's what the wind proc for the class looks like in it's entirety:
LRESULT CLeftView::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return OnNcCalcSize(wParam, lParam);
return OnNcPaint(wParam, lParam);
// Pass unhandled messages on to parent WndProcreturn WndProcDefault(hWnd, uMsg, wParam, lParam);
I'm afraid I have no recollection of where I picked this trick up, though it seems to work just fine. If I've left things unexplained, or you like the class source, I'd be happy to expand on what I've said, or mail you a copy of the class.
[EDIT: Oops, looks like I misread that first post. Sorry 'bout that Jim. I've not used the functions you mention before, I'll see if I cant come up with something that achieves this affect using them.]
Hi,using native C++ in dlls called from a VB.NET application I want to dynamically allocate up to 3 GB of memory, in stages, using the “new” command.
The following code (example to illustrate the problem) produces the following error “Unhandled exception at 0x7c81eb33 n VMTest.exe: Microsoft C++ exception:std::bad_alloc at memory location 0x0012fe10..”
I have configured the virtual memory under control panel|system properties|Advanced tab|Advanced tab|settings to “System managed size” and customised with Initial size = 756 and Maximum size = 8192 with no success. I am using VS2005 on XP SP2.
Please can anybody advise me on a way forward using the "new" command or an alternative.
using namespace std;
int _tmain(int argc, _TCHAR* argv)
int count = 1000000000;
Hi Cedric, system requirements change. The application I am working now has to process large amounts of raw (binary) data. I was under the impression that Windows XP virual memory management would take care of data larger than RAM size. I could change the program so that I read chuncks i.e 0.5 GB at a time but this will impact other parts of the system.
My current development PC has 1GB of memory so I have will be upgrading as soon as possible.
Windows XP virual memory management would take care of data larger than RAM size
It will but if you're gong to be manipulating those huge chunks of memory at once - as in repeatedly allocating 4 GB then running through the entire 4G allocation - you're system is going to be constantly thrashing on the paging file. The additional time spent accessing the hard drive is probably going to be greater than whatever time you will gain be rewriting your logic to use the bigger chunks of memory. Processor speeds blow away disk access speeds.
Also, even if you put more than 4G of physical memory in your machine, XP cannot access it. It has a hard upper limit of 43G (32G using the default settings).
modified on Tuesday, April 15, 2008 8:38 AM
Last Visit: 31-Dec-99 19:00 Last Update: 5-Dec-23 17:58