|
You are doing WAY too much in response to a WM_TIMER message that occurs every 1/2 second.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
What, pray tell, are you finding amusing?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
it was just obvious, but i loved the way you said it
|
|
|
|
|
it has no businiss with the timer, because when i change it to 2second, it also appear error:
(step debug)
unhandled exception in SerialRecieve.exe(KERNEL32.DLL):0xE06D7363:Microsoft C++ EXCEPTION
no matter where the error appears, it appears always in the CSerialRecieveDlg::OnTimer(UINT nIDEvent)
wuhuaiji
|
|
|
|
|
nibabug wrote: it has no businiss with the timer...it appears always in the CSerialRecieveDlg::OnTimer(UINT nIDEvent)
Do you see the irony in this statement? Yes, the timer is the problem. Changing the frequency to 2 seconds won't necessarily solve the problem if it takes longer than that to process a single WM_TIMER request. Put a flag in the function indicating whether it is busy or not. Check that flag before continuing.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It's not just the timer - a thread hosting Windows UI can only process one message at a time, after all. The problem is that the MessageBox call and the modal dialog create nested message loops, which will process timer messages and thereby cause recursion.
Most likely it's one of the AfxMessageBox calls in the exception handlers in the OnTimer routine which is causing OnTimer to go re-entrant.
DoEvents : Generating unexpected recursion since 1991
|
|
|
|
|
thanks a lot
wuhuaiji
|
|
|
|
|
Try single stepping through your code in the debugger, it should be obvious then.
|
|
|
|
|
Hello!
I am trying to monitor the hard drive LED via a program I am writing in C++ for Windows XP. I just need to know if the light is on/off (the hard drive running). The user will not be able to see the light because of the placement of the computer & we cannot crack open the computer to wire it someplace else because of warranty issues. I need to incorporate it directly into a program I am writing - I cannot use any off the shelf program to show me the LED in the corner of the windows page because my custom display will take up the whole screen.
Any suggestions of how to get to status of the hard drive LED from my c++ program?
Thanks!
Margaret
|
|
|
|
|
Why don't you just monitor disk activity itself, rather than mess with the LED (which is probably not accessible anyway)?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Mine is not question .. I just the worker bee. They want to mimick the light for the panel I am creating. If there is another way to monitor that the hard drive is being used/written to - am way open to suggestions!
Thanks
|
|
|
|
|
isikorsky91 wrote: They want to mimick the light
Since the LED is just blinking in unison with disk activity, your panel can do the same thing.
isikorsky91 wrote: If there is another way to monitor that the hard drive is being used/written to - am way open to suggestions!
A device driver is the only way.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Can you point me to any examples ? I am not clear on what you are referring to here. I have scoured the internet for hooks into windows to program into the code to monitor hard drive activity and come up with nothing ..
|
|
|
|
|
isikorsky91 wrote: Can you point me to any examples ?
See here and here.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Thanks .. but
I don't see how I can use DiskMon in my code since it is a precompiled program. The other option see a little beyond my scope of what I was looking for.. I was just looking for a simpler call to windows to find out if there is hard disk activity...
Guess I am missing what you are pointing out..
Thanks
|
|
|
|
|
isikorsky91 wrote: I don't see how I can use DiskMon in my code since it is a precompiled program.
I never indicated you could. It was merely for you to read on how it was done, and the complexity involved.
isikorsky91 wrote: Guess I am missing what you are pointing out..
Did you read this:
Windows 2000 and Higher Implementation
On Windows 2000 and higher, Diskmon uses kernel event tracing. Event tracing is documented in the Microsoft Platform SDK and the SDK contains source code to TraceDmp, on which Diskmon is based.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
How to draw a table on a dialog in VC++ ??? I'm a newbie.....
Thnk u
|
|
|
|
|
gReaen wrote: How to draw a table...
That depends on what you mean by "table." There is a multicolumn list control, and a grid control that can be placed on a dialog, but not a table.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
you can add flexgrid from project>addtoproject>components and controls>registered Active X components
Suggestion to the members:
prefix your main thread subject with [SOLVED] if it is solved.
chandu.
|
|
|
|
|
how can i use constant member varible in simple class?
I want ot use it as private.
Thanks...
|
|
|
|
|
ashishbhatt wrote: how can i use constant member varible in simple class?
class ConstantTest
{
ConstantTest() : m_SomeConstant( 10 )
{}
private:
const int m_SomeConstant;
enum { AnotherConstant = 20 };
};
Nibu thomas
MVP For VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
|
|
|
|
|
Thank u v much Nibu.
|
|
|
|
|
for example :
class Tata
{
private:
const int m_ConstMember;
public:
Tata();
};
Tata::Tata() : m_ConstMember( 42 )
{
}
|
|
|
|