|
Are you sure your code is actually running properly? The code that you posted in your original question will not even compile, so there may be some other bugs in your program.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Could it be the video driver? Could your keyboard/mouse be keeping the computer "alive?" Do you have Power Management configured correctly?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
can you please give some hint what shall be the power management for this ?
Please brother do reply soon ..Lots of my work depends on it ..
|
|
|
|
|
@DavidCrow : You are genius man .. Thankxx a lot .. As you said its just because of my Graphics driver . Earlier my graphics driver was not compatible with the hardware .. Now i have installed the new driver .. and the issue is resolved.. Thankxx again ..
|
|
|
|
|
std::list<int> lstDevices;
...
...
std::list<int>::iterator iter;
std::list<int>::iterator iter2Delete;
for(iter = lstDevices.begin(); iter != lstDevices.end();)
{
iter2Delete = iter++;
lstDevices.erase(iter2Delete);
}
Use iter2Delete to save current iterator and then let iter pointer to next item. Then delete current item. Does this way have problem?
|
|
|
|
|
See here[^] for a description and sample code showing how to erase a range of elements.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi,
Thank you for your replay, after see this article, I find that I am right.
Thankyou a lot.
#include "stdafx.h"
#include <list>
#include <iostream>
int main( )
{
using namespace std;
list <int> c1;
list <int>::iterator Iter;
c1.push_back( 10 );
c1.push_back( 20 );
c1.push_back( 30 );
c1.push_back( 40 );
c1.push_back( 50 );
cout << "The initial list is:";
for ( Iter = c1.begin( ); Iter != c1.end( ); Iter++ )
cout << " " << *Iter;
cout << endl;
std::list<int>::iterator iter;
std::list<int>::iterator iter2Delete;
for(iter = c1.begin(); iter != c1.end();)
{
iter2Delete = iter++;
c1.erase(iter2Delete);
}
for (Iter = c1.begin( ); Iter != c1.end( ); Iter++ )
cout << " " << *Iter;
cout << endl;
}
|
|
|
|
|
Why not use the features of the class and do it the easy way?
c1.erase( c1.begin(), c1.end( ) );
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Or just this:
c1.clear();
Steve
|
|
|
|
|
|
Hi
Is there any way to get the pasted text in a dialog?
Any control in the dialog may have the focus.
Regards
www.logicsims.ir
|
|
|
|
|
You can read the contents of the clipboard with the GetClipboardData() [^] function, and write it to any control.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Thanks
But I want to get the text when it's pasted.
I checked WM_PASTE but it is send to the control that has the focus not it's parent CWnd.
My dialog has some control of buttons, edit boxes, list control, ...
so it is posible that any of these controls has the focus (when something is paste)
Regards
www.logicsims.ir
|
|
|
|
|
You need to subclass the controls[^] and capture the message that way.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
hi all,
i want to the disk number of a logical drive please help me how can i do this.
thanks.
|
|
|
|
|
What do you mean by "disk number"?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
disk may have multiple logical drive.
so i want to know the selected logical drive related to which disk.
|
|
|
|
|
Check out these functions[^]. It's a while since I have done this but I'm afraid it is somewhat involved in terms of getting mutliple sets of information and matching the pieces together. Hey, if it wasn't Microsoft it wouldn't be fun.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
|
Need to make an infix to postfix converter. how do i do it?
ST
|
|
|
|
|
Probably by writing a program; but without some more details of exactly what you are trying to do it is difficult to be more precise.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
I have a CDateTimeCtrl on my dialog. Through this I can choose any date in given range from drop down. But currently user is also allowed to press numeric keys to set the date. Is there any way to stop user from typing in it. I want, he should only be able to select the date from drop-down and I don't want to disable the control.
I have checked the "AllowEdit" property but that is different thing. Currently it is set to false.
|
|
|
|
|
You may derive a class from CDateTimeCtrl() and add a WM_CHAR / OnChar() handler that does nothing or calls the base class handler for non-digit chars only.
I've just tested it. It does not effect keys pressed in the drop down calendar and still allows cursor keys and TAB in the edit control.
|
|
|
|
|
Thanks Jochen, you are right. That way it will work. But for such a small requirement, I don't want to do big changes and also I don't want to go for pretranslate message. Is there any way to handle WM_CHAR/OnChar events for the date control on the same dialog class?
|
|
|
|