Hi I need to write DLL with two functions via Dev-C++ to get two items:
1/. "select UniqueId from Win32_Processor"
2/. "select SerialNumber from Win32_DiskDrive"
Both of the fuctions must return string values using using System.Management
of WMI (Windows Management Instrumentation Win32 Classes).
Has anybody any IDEA ?
Best Regards,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I use C++ in my project. I need two functions in C++ what return string values
of Processor ID and HDD ID.
Next I would like to implement and export them in DLL using DEV-C++.
Install the WMI on your computer.
Create a Dev-Cpp project file with paths to the WMI files.
Write a "main" function (without the WMI) that compiles with the project file.
Add the "using System.Management" statement and the "ManagementObjectSearcher
searcher = new ManagementObjectSearcher("select * from " + Key);" statement.
Check for an error in obtaining the "searcher" object.
Compile without errors.
Then you can obtain the data from the object using the "searcher" pointer .
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for the answer. I have two additional questions to You:
You wrote: "Do the following if you haven't done so already. Install the WMI
on your computer."
Question: What files, from what page should I download WMI files for Windows
XP/7/Vista ?
You wrote: "Create a Dev-Cpp project file with paths to the WMI files."
Question: What project type should I create (DLL, empty or source project) and
where can I set the path to the WMI files on DEV-C++?
Best Regards,
Piotr
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You wrote:
"Create a Dev-Cpp project file with paths to the WMI files. Write a "main"
function (without the WMI) that compiles with the project file."
question 1: How to write function main() without WMI files?
You wrote:
Add the "using System.Management" statement and the "ManagementObjectSearcher
searcher = new ManagementObjectSearcher("select * from " + Key);" statement.
Check for an error in obtaining the "searcher" object. Compile without errors.
question 2: How to do this? Any example?
I do not know how to compile WMI files in my project in DEV-C++
Rgds,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi I need to write DLL with two functions via Dev-C++ to get two items:
1/. "select UniqueId from Win32_Processor"
2/. "select SerialNumber from Win32_DiskDrive"
Both of the fuctions must return string values using using System.Management
of WMI (Windows Management Instrumentation Win32 Classes).
Has anybody any IDEA ?
Best Regards,
You need to be more specific with your question.
What do you need help with? the DLL? the functions? the Windows API?
Hi jimp03,
I need help for writing functions in DEV-C++ that return string values:
1/. first function CPU_ID ()
2/. second function HDD_ID ()
using WMI...
I wrote examples how to get items from WMI.
Here is description for the WMI Classes I need:
1/. for CPU_ID() -> http://msdn.microsoft.com/en-us/library/windows/desktop/a
a394373%28v=VS.85%29.aspx
( I am intresting only with UniqueId of Win32_Processor WMI class. How to
return UniqueId for CPU as string value on DEV-C++? )
2/. for HDD_ID() -> http://msdn.microsoft.com/en-us/library/windows/desktop/a
a394132%28v=VS.85%29.aspx
( I am intresting only with SerialNumber of Win32_DiskDrive WMI class. How to
return SerialNumber of HDD as string value on DEV-C++? )
How to get above string values via DEV-C++ ?
It is not EASY for ME, but VERY VERY useful.
Rgds,
You wrote examples how to get items from WMI.
What programming language were they written in? What development environment
did you use?
Hi Again,
I use C++ in my project. I need two functions in C++ what return string values
of Processor ID and HDD ID.
Next I would like to implement and export them in DLL using DEV-C++.
I don't know how to call WMI under DEV-C++. What file should I include?
Pls for any example how to write something like this http://www.codeproject.c
om/KB/system/GetHardwareInformation.aspx using the DEV-C++
Rgds,
Piotr
Do the following if you haven't done so already.
Install the WMI on your computer.
Create a Dev-Cpp project file with paths to the WMI files.
Write a "main" function (without the WMI) that compiles with the project file.
Add the "using System.Management" statement and the "ManagementObjectSearcher
searcher = new ManagementObjectSearcher("select * from " + Key);" statement.
Check for an error in obtaining the "searcher" object.
Compile without errors.
Then you can obtain the data from the object using the "searcher" pointer .
Hi jimp03,
Thank you for the answer. I have two additional questions to You:
You wrote: "Do the following if you haven't done so already. Install the WMI
on your computer."
Question: What files, from what page should I download WMI files for Windows
XP/7/Vista ?
You wrote: "Create a Dev-Cpp project file with paths to the WMI files."
Question: What project type should I create (DLL, empty or source project) and
where can I set the path to the WMI files on DEV-C++?
Best Regards,
Piotr
Hi jimp03 again,
You wrote:
"Create a Dev-Cpp project file with paths to the WMI files. Write a "main"
function (without the WMI) that compiles with the project file."
question 1: How to write function main() without WMI files?
You wrote:
Add the "using System.Management" statement and the "ManagementObjectSearcher
searcher = new ManagementObjectSearcher("select * from " + Key);" statement.
Check for an error in obtaining the "searcher" object. Compile without errors.
question 2: How to do this? Any example?
I do not know how to compile WMI files in my project in DEV-C++
Rgds,