Witam.Chciałbym wyciągnąć z pomocą c++ informację z biosu, poczytałem i znalazłem coś takiego
[Dynamic, Provider("CIMWin32"), UUID("{8502C4E1-5FBB-11D2-AAC1-006008C78BC7}"), AMENDMENT]
class Win32_BIOS : CIM_BIOSElement
{
uint16 BiosCharacteristics[];
string BIOSVersion[];
string BuildNumber;
string Caption;
string CodeSet;
string CurrentLanguage;
string Description;
uint8 EmbeddedControllerMajorVersion;
uint8 EmbeddedControllerMinorVersion;
string IdentificationCode;
uint16 InstallableLanguages;
datetime InstallDate;
string LanguageEdition;
String ListOfLanguages[];
string Manufacturer;
string Name;
string OtherTargetOS;
boolean PrimaryBIOS;
datetime ReleaseDate;
string SerialNumber;
string SMBIOSBIOSVersion;
uint16 SMBIOSMajorVersion;
uint16 SMBIOSMinorVersion;
boolean SMBIOSPresent;
string SoftwareElementID;
uint16 SoftwareElementState;
string Status;
uint8 SystemBiosMajorVersion;
uint8 SystemBiosMinorVersion;
uint16 TargetOperatingSystem;
string Version;
};
Źródło: https://docs.microsoft.com/en-us/windows/win32/cimwin32prov/win32-bios?redirectedfrom=MSDN#properties
No więc, idąc dalej wyczytałem,że trzeba stworzyć nową instancję istniejącej klasy,więc wykonałem
#include <wbemidl.h>
IWbemServices *pSvc;
IWbemClassObject *pNewInstance = 0;
IWbemClassObject *pExampleClass = 0;
IWbemContext *pCtx = 0;
IWbemCallResult *pResult = 0;
BSTR PathToClass = SysAllocString(L"Win32_BIOS");
HRESULT hRes = pSvc->GetObject(PathToClass, 0, pCtx,
&pExampleClass, &pResult);
pExampleClass->SpawnInstance(0, &pNewInstance);
Kompilator mówi "unkown typename 'pExampleClass' " O co tu chodzi? Czy to znak,że funkcja nie zwróciła obiektu do tego wskaźnika? Jeszcze tu źródło funkci GetObject: https://docs.microsoft.com/en-us/windows/win32/api/wbemcli/nf-wbemcli-iwbemservices-getobject