- Joined
- Aug 14, 2009
- Messages
- 2,304
- Reaction score
- 1,189
Re: [RELEASE] 3D Fantasy MMORPG ybtx(佣兵天下) full source
This is a better fix for the RunModule problem. Since Windows 10 doesn't have a servicepack, WMI returns null. For all other operating systems (Windows 7 etc. it returns SP1, SP2 etc.)
This is a better fix for the RunModule problem. Since Windows 10 doesn't have a servicepack, WMI returns null. For all other operating systems (Windows 7 etc. it returns SP1, SP2 etc.)
Code:
VARIANT vtProp;
char* tcode;
// Get the value of the Name property
hr = pclsObj->Get(L"Caption", 0, &vtProp, 0, 0);
tcode = _com_util::ConvertBSTRToString(vtProp.bstrVal) ;
OSName = tcode;
GfkSafeDelete(tcode);
VariantClear(&vtProp);
hr = pclsObj->Get(L"CSDVersion", 0, &vtProp, 0, 0);
if(vtProp.bstrVal == NULL)
OSServPack = std::string();
else{
tcode = _com_util::ConvertBSTRToString(vtProp.bstrVal);
OSServPack = tcode;
GfkSafeDelete(tcode);
VariantClear(&vtProp);
}
Last edited: