|
Dear Readers,
In my project i m facing problem of memory model at some stage if my internal memory usage is exceed then its gice me error or some times it dont allow to open perticuler window. this is done if i make my double array size id huge like 800000 count.so please help me wht to do for this.and i cant able to use CArray of such type of things. so pleas ehelp me for this.
gunjan
|
|
|
|
|
In 16-bit programs, there was the option of different memory models, but in 32-bit, and 64-bit, it is Flat. So you can allocate as much memory as the OS will allow you. The problem seems like the OS is denying you memory. Solution should be (I think) Allow more hard disk space on the drive where windows is installed. And, Install more Ram.
this is this.
|
|
|
|
|
In a 32 bit windows program you can not make a single array larger than about 1.2 GB of memory unless you use the LARGEADDRESSAWARE complier flag and boot with a system that supports such a flag. There is some info here about this:
[EDIT]Oops... That is not that big of an array, look below for the solution. [/EDIT]
John
-- modified at 5:44 Tuesday 25th October, 2005
|
|
|
|
|
Hi,
How do you allocate the memory??
Like an array
double dblID[800000];
if this is the case the stack could be to small so you have to create it on the heap instead like this:
<code>double* pDblArray = new double[800000];
pDblArray[0] = 0.0;
delete [] pDblArray;</code>
Hope this solves your problem
codito ergo sum
|
|
|
|
|
Thank you for your valuable replay. If i want to create such a big two dimentional array then what i have to do.
|
|
|
|
|
I want to change the back colour of my Edit Box
Any one has done that???
I use such code but was not effective ,wanted a
blinking backcolour of the edit box so used a
timer event to change the colour but it didnot
change the colour
{
// TODO: Add your message handler code here and/or call default
pDC=m_display_msg.GetDC ();
pDC->SetBkColor (RGB(255,0,0));
m_display_msg.Invalidate (TRUE);
pDC->SetBkMode(OPAQUE);
m_display_msg.SetWindowText ("Event Occured ");
m_display_msg.UpdateWindow ();
//pDC->Invalidate();
this->Invalidate (TRUE);
CDialog::OnTimer(nIDEvent);
}
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Edit controls send a WM_CTLCOLOREDIT message to their parents when they need to repaint.
Try to provide a handler for that message, from that return a HANDLE to a brush which will be used to paint the background. If you need your color to blink use the timer to invalidate the control and alternate the colors you provide in you timer event handler.
|
|
|
|
|
Yeh i know that but any other way???
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Yeh i know that but any other way???
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
I supose you could derive a class from CEdit and override OnPaint, but that doesn't seem an easy thing to to. When I had to custom draw an edit control I used WM_CTLCOLOREDIT, that's the easiest way I know.
|
|
|
|
|
why is that you dont want to use WM_CTLCOLOR,Any problem with this .
-- modified at 8:10 Tuesday 25th October, 2005
|
|
|
|
|
Yeh we Humans always want an easy way ,
during exploring the codeproject site
i found one derived class for CEdit
who did some things similar to changing
the colour .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
so, did you had a look a the source to find out how the guy was changing the color of his editBox ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
still you didn't leave this topic...??? i appriciate your attitude.. but if something(of lesser importance) takes too much time, we should consider skipping it .
He is like a one-legged man in a bum kicking competition. -Novjot Sidhu
--[v]--
|
|
|
|
|
VivekuniQ wrote: if something(of lesser importance) takes too much time, we should consider skipping it .
Thats What we call Right attitude to develop the Software..
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
1. How do we write an exit handle for a windows app that gets executed even when an app is terminated from the task manager?
2. when the app is terminated from the task manager, a DLL's processdetach doesnt seem to get called. what then is the way to cleanup the DLL in this case?
thanks.
|
|
|
|
|
conceptus wrote: How do we write an exit handle for a windows app that gets executed even when an app is terminated from the task manager?
Isn't WM_CLOSE the message you want ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I dont know. Does it take care of the case when someone terminates it from the task manager 1)generally and 2)when app is not responding?
thanks
|
|
|
|
|
Sorry man, WM_CLOSE will never get called. It gets called when the user exits the app using the close button etc.
There is something more which is done.
this is this.
|
|
|
|
|
WM_CLOSE wont work for that u should find some other way .
But as far as i know if the application is not responding
and is teriminated by the user through End_Task method .
There is now way it can process messages.
There are two solutions:-
1> Use another application which uses HOOK funda
2> Disable the Task Manager
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
Mmmh, may I ask why you want to do such a thing ? Closing your app with the Task Manager is not a solution ! Maybe you better find a solution to the root problem (why it hangs when you try to exit your program).
|
|
|
|
|
Cedric Moonen wrote: Closing your app with the Task Manager is not a solution ! Maybe you better find a solution to the root problem (why it hangs when you try to exit your program).
My program doesnt hang, nor do I ask the end users to terminate it through task manager. However, for the sake of completeness, I still want to consider this case of doing cleanup, who knows in some dire situation the end user may really want to terminate the app. They are using windows afterall
let me know if there is a solution.
|
|
|
|
|
If you start thinking like that, you can also suppose that you'll need to save your data every 10 seconds because a crash of the system can occur (or no power), that you have to ask for confirmation for everything the user enter as data because it may be the cat that is walking on the keyboard, ...
And for the sake of completeness, you may also detect that a mouse, a keyboard and a screen are well connected to your computer .
It is clear that using the TaskManager to close an application will result in memory leaks (it is clearly stated when you try to kill an app). But if the user still want to continue, then it's up to him.
|
|
|
|
|
i like this way of thinking !
'5' for you
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I understand. How about this: I have some buffered data that I need to flush when the app exits. How do I make sure this always happens.
All I need to know is whether this is possible. The product will anyway ship even if this part doesnt get into it, but I just wanted to know if anyone handles it or leaves it to destiny...that is, windows OS
|
|
|
|