Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Win32 Processor - How to implement this correctly?

Win32 Processor - How to implement this correctly?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialvisual-studiocomhardwarequestion
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rbwest86
    wrote on last edited by
    #1

    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.

    K G A 3 Replies Last reply
    0
    • R rbwest86

      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.

      K Offline
      K Offline
      KingsGambit
      wrote on last edited by
      #2
      1. 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 :)
      1 Reply Last reply
      0
      • R rbwest86

        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.

        G Offline
        G Offline
        Garth J Lancaster
        wrote on last edited by
        #3

        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'

        1 Reply Last reply
        0
        • R rbwest86

          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.

          A Offline
          A Offline
          Adam Roderick J
          wrote on last edited by
          #4

          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.

          Величие не Бога может быть недооценена.

          R 1 Reply Last reply
          0
          • A Adam Roderick J

            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.

            Величие не Бога может быть недооценена.

            R Offline
            R Offline
            rbwest86
            wrote on last edited by
            #5

            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.

            R A 2 Replies Last reply
            0
            • R rbwest86

              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.

              R Offline
              R Offline
              rbwest86
              wrote on last edited by
              #6

              bump?

              1 Reply Last reply
              0
              • R rbwest86

                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.

                A Offline
                A Offline
                Adam Roderick J
                wrote on last edited by
                #7

                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

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups