Win32 Processor - How to implement this correctly?
-
I am tying to figure out and start small on retrieving hardware information. I am making a very simple program that does this: 1.) Find processor information 2.) Write found information to a log file ".txt" 3.) Display the found information on the screen Very simple right? So I found this Win32 Processor Class at: Win32 Processor Class What I dont understand is how to implement this. On the website it does not say how to utilize this code. If it does, I do not see the example that is being displayed. I just see the breakdown of the Win32 Processor class and not a typical usage scenario. So if anyone can please provide me some clarification on how to utilize this class correctly please respond back to this with what bits of information I have failed to recognize.
-
I am tying to figure out and start small on retrieving hardware information. I am making a very simple program that does this: 1.) Find processor information 2.) Write found information to a log file ".txt" 3.) Display the found information on the screen Very simple right? So I found this Win32 Processor Class at: Win32 Processor Class What I dont understand is how to implement this. On the website it does not say how to utilize this code. If it does, I do not see the example that is being displayed. I just see the breakdown of the Win32 Processor class and not a typical usage scenario. So if anyone can please provide me some clarification on how to utilize this class correctly please respond back to this with what bits of information I have failed to recognize.
- You can use GetSystemInf() API to get the information regarding the processor: http://msdn.microsoft.com/en-us/library/ms724423(VS.85).aspx[^] 2) You can use file stream classes to create the text file: http://www.cplusplus.com/doc/tutorial/files/[^] 3) You can use cout to display the result to the console. http://www.cplusplus.com/reference/iostream/cout/[^] 4) You can get all these by searching google :)
-
I am tying to figure out and start small on retrieving hardware information. I am making a very simple program that does this: 1.) Find processor information 2.) Write found information to a log file ".txt" 3.) Display the found information on the screen Very simple right? So I found this Win32 Processor Class at: Win32 Processor Class What I dont understand is how to implement this. On the website it does not say how to utilize this code. If it does, I do not see the example that is being displayed. I just see the breakdown of the Win32 Processor class and not a typical usage scenario. So if anyone can please provide me some clarification on how to utilize this class correctly please respond back to this with what bits of information I have failed to recognize.
the example you point to is using a technology called WMI - Windows Management Instrumentation .. some examples on general WMI are here :- http://msdn.microsoft.com/en-us/library/aa394558(VS.85).aspx[^] they might help you get going - WMI exposes a lot, but I dont think its necessarily the easiest of technologies to use/start with - others may disagree. If I can find another starter for you I'll post back 'g'
-
I am tying to figure out and start small on retrieving hardware information. I am making a very simple program that does this: 1.) Find processor information 2.) Write found information to a log file ".txt" 3.) Display the found information on the screen Very simple right? So I found this Win32 Processor Class at: Win32 Processor Class What I dont understand is how to implement this. On the website it does not say how to utilize this code. If it does, I do not see the example that is being displayed. I just see the breakdown of the Win32 Processor class and not a typical usage scenario. So if anyone can please provide me some clarification on how to utilize this class correctly please respond back to this with what bits of information I have failed to recognize.
The class you saw is WMI class, i prefer to use that. The usage of class is mentioned in link itself, just check this(http://msdn.microsoft.com/en-us/library/aa390423(VS.85).aspx) It is WMI so you need to handle like a COM. Well try that, else you can go for suggestion from Rejeesh.
Величие не Бога может быть недооценена.
-
The class you saw is WMI class, i prefer to use that. The usage of class is mentioned in link itself, just check this(http://msdn.microsoft.com/en-us/library/aa390423(VS.85).aspx) It is WMI so you need to handle like a COM. Well try that, else you can go for suggestion from Rejeesh.
Величие не Бога может быть недооценена.
Ok, So after looking at doing this I feel I need to use WMI (Windows Management Instrumentation). Now to make sure I understand this, WMI is a tool that windows uses to read hardware information very accurately? Now back to the programming portion. In order for me to use Win32_Processor Class, I first have to initialize CoInitilizeEx and CoInitilizeSecurity? I am a little confused about this. The COM (Component) is a library, and this library tells WMI and the Win32_Processor Class how to communicate with hardware? Just making sure I understand everything and trying to put everything together.
-
Ok, So after looking at doing this I feel I need to use WMI (Windows Management Instrumentation). Now to make sure I understand this, WMI is a tool that windows uses to read hardware information very accurately? Now back to the programming portion. In order for me to use Win32_Processor Class, I first have to initialize CoInitilizeEx and CoInitilizeSecurity? I am a little confused about this. The COM (Component) is a library, and this library tells WMI and the Win32_Processor Class how to communicate with hardware? Just making sure I understand everything and trying to put everything together.
-
Ok, So after looking at doing this I feel I need to use WMI (Windows Management Instrumentation). Now to make sure I understand this, WMI is a tool that windows uses to read hardware information very accurately? Now back to the programming portion. In order for me to use Win32_Processor Class, I first have to initialize CoInitilizeEx and CoInitilizeSecurity? I am a little confused about this. The COM (Component) is a library, and this library tells WMI and the Win32_Processor Class how to communicate with hardware? Just making sure I understand everything and trying to put everything together.
WMI is very useful, It is used because of its high performance, and its extensible event mechanism. It can used to get information of remote systems using DCOM. WMI can be used to define a permanent consumer for a event. It works like a query, you can write the syntax of SQL to retrieve the system information. eg:- "SELECT * FROM Win32_Process WHERE WorkingSetSize >= 10000" This can queried from many languages. Now to make sure I understand this, WMI is a tool that windows uses to read hardware information very accurately? I know WMI is accurate, but dont know whether APIs are not. ;) Just read the WMI architecture, http://msdn.microsoft.com/en-us/library/aa394553(VS.85).aspx. and read the various COM API that can be useful http://msdn.microsoft.com/en-us/library/aa389276(VS.85).aspx I am sure your doubts are no longer going to sustain. ;)
Величие не Бога может быть недооценена.
modified on Sunday, March 28, 2010 1:20 AM