S
Stephan Schaem
get this string when I press CTRL-F5 to run:
ØB-
I get this string when I press F5 to run:
Mobile Intel(R) Celeron(R) CPU 1.50GHz
I started with a 100% C++ unmanaged program and
I wanted to display the processor name, and so I gave the .net framework a try.
So I injected this code in one of the .cpp file (nothing more, nothing less)
#using <system.dll>
#using <System.Management.dll>
using namespace System;
using namespace System::Management;
void Function() {
......
ManagementObjectSearcher* query1 = new ManagementObjectSearcher("SELECT * FROM Win32_processor") ;
ManagementObjectCollection* queryCollection1 = query1->Get();
ManagementObjectCollection::ManagementObjectEnumerator* queryEnum1 = queryCollection1->GetEnumerator();
queryEnum1->MoveNext();
ManagementBaseObject* object = queryEnum1->get_Current();
Object* cpuName = object->GetPropertyValue(L"Name");
.....
// Emit html with processor name
html.td(AtlHtmlAttrs("%s", cpuName->ToString()));
}
Stephan
ØB-
I get this string when I press F5 to run:
Mobile Intel(R) Celeron(R) CPU 1.50GHz
I started with a 100% C++ unmanaged program and
I wanted to display the processor name, and so I gave the .net framework a try.
So I injected this code in one of the .cpp file (nothing more, nothing less)
#using <system.dll>
#using <System.Management.dll>
using namespace System;
using namespace System::Management;
void Function() {
......
ManagementObjectSearcher* query1 = new ManagementObjectSearcher("SELECT * FROM Win32_processor") ;
ManagementObjectCollection* queryCollection1 = query1->Get();
ManagementObjectCollection::ManagementObjectEnumerator* queryEnum1 = queryCollection1->GetEnumerator();
queryEnum1->MoveNext();
ManagementBaseObject* object = queryEnum1->get_Current();
Object* cpuName = object->GetPropertyValue(L"Name");
.....
// Emit html with processor name
html.td(AtlHtmlAttrs("%s", cpuName->ToString()));
}
Stephan