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.Managem ent.dll>
using namespace System;
using namespace System::Managem ent;
void Function() {
......
ManagementObjec tSearcher* query1 = new ManagementObjec tSearcher("SELE CT * FROM Win32_processor ") ;
ManagementObjec tCollection* queryCollection 1 = query1->Get();
ManagementObjec tCollection::Ma nagementObjectE numerator* queryEnum1 = queryCollection 1->GetEnumerator( );
queryEnum1->MoveNext();
ManagementBaseO bject* object = queryEnum1->get_Current( );
Object* cpuName = object->GetPropertyVal ue(L"Name");
.....
// Emit html with processor name
html.td(AtlHtml Attrs("%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.Managem ent.dll>
using namespace System;
using namespace System::Managem ent;
void Function() {
......
ManagementObjec tSearcher* query1 = new ManagementObjec tSearcher("SELE CT * FROM Win32_processor ") ;
ManagementObjec tCollection* queryCollection 1 = query1->Get();
ManagementObjec tCollection::Ma nagementObjectE numerator* queryEnum1 = queryCollection 1->GetEnumerator( );
queryEnum1->MoveNext();
ManagementBaseO bject* object = queryEnum1->get_Current( );
Object* cpuName = object->GetPropertyVal ue(L"Name");
.....
// Emit html with processor name
html.td(AtlHtml Attrs("%s", cpuName->ToString())) ;
}
Stephan
Comment