|
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 )
{
}
|
|
|
|
|
Hi Experts,
In my program there are two view , one is ListView another is HtmlView.
Wihtout clicking on HtmlView I can select the ListView content by keyborad key. But when I click on HtmlView, focus lost from ListView and do not come in the ListView even after clicking on ListView.It(focus) remains in the HtmlView .
|
|
|
|
|
I have mounted a drive to a directory(i.e. created a junction point) using mountvol.exe as well as through diskmgmt.msc. Now I would like to mount a remote drive to a directory, but unable to do that. Do anyone has some idea.
Smile.
|
|
|
|
|
Hi!!
I'm working on a C++ source code, in Visual C++ (i didn't build it) and a have to compile it to a DLL from that code. The problem is that the C++ code has a mex function (with MxArray) and it needs to be connected with Matlab to run it. I can't use the Matlab compiler toolbox, I have to use something like the Matlab Project Wizard ( but i was told it's not supported anymore...).
Any suggestions??
Thanks!!
Gui
|
|
|
|
|
It seems to me, the whole mex-approach is discontinued by MathWorks.
Here, we use the Matlab-compiler to build DLLs containing the Matlab code.
These Matlab dlls in turn rely on a matlab-runtime and a so called ctf-File containing the (encrypted) matlab code to be executed.
The DLL conatains bindings to call the Matlab-code from C++ and to wrap c++ datastructures for Matlab (mwArray).
There is no problem to call this Matlab-Dll from a self-written DLL.
Hope this helps at least a little.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
The problem is that i don't have matlab-compiler...
|
|
|
|
|
Hi all,
I've create a char type buffer as follows.
char tempBuffer[256] ;
Then I use some text to a file using that buffer as follows.
openFile.Write(readString, sizeof(tempBufferWrite)) ;
Now my question is this. Say I'm write something to the file which is the length is less than 256 characters. File contains the text I wrote to it and after that filled up with annoying characters until reach to 256 total characters. I want to avoid such annoying characters.
So, is there any way to initialize the buffer with empty characters, or the size define the length of the string(text I have write to the file)
Thanks
Eranga
I appreciate your help all the time...
|
|
|
|
|
char tempBuffer[256] = <code>{0}</code>;
|
|
|
|
|
Yep I have try it, but no luck. Initially I thought that letter '0' initialize in all 256 memory locations. And also I've tried this.
char tempBufferWrite[256] = {} ;
Even though print some annoying text.
For more explanation see this code,
<br />
void CSRFToolDlg::OnBnClickedWrite()<br />
{<br />
char tempBufferWrite[256] = {0} ;
openFile.Write("text of letters", sizeof(tempBufferWrite)) ;<br />
openFile.Flush() ;<br />
}<br />
Eranga
I appreciate your help all the time...
|
|
|
|