本文介绍了C ++ WMI UINT64问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个WMI类,并且我读得很好,我有几个读取属性的小functins.显然每个属性都有不同的属性类型.
我的问题是,您将用什么来阅读uint64?
对于字符串:
I have a WMI class and im reading fine, I have a couple of small functins that read properties. Obviously each will have a different property type.
My question is what would you use to read the uint64?
For Strings:
void WMIReader::ReadPropertyString( WCHAR* PropertyName, char* ReturnBuffer )
{
VARIANT pProperty;
ClassObject->Get( PropertyName, 0, &pProperty, 0, 0 );
sprintf( ReturnBuffer, "%S", pProperty.bstrVal ); //bstrVal for strings
VariantClear( &pProperty );
}
对于整数:
For Integers:
void WMIReader::ReadPropertyInt( WCHAR* PropertyName, char* ReturnBuffer )
{
VARIANT pProperty;
ClassObject->Get( PropertyName, 0, &pProperty, 0, 0 );
sprintf( ReturnBuffer, "%i", pProperty.intVal ); //intVal for integers
VariantClear( &pProperty );
}
对于UINT64:
For UINT64:
void WMIReader::ReadPropertyInt( WCHAR* PropertyName, char* ReturnBuffer )
{
VARIANT pProperty;
ClassObject->Get( PropertyName, 0, &pProperty, 0, 0 );
sprintf( ReturnBuffer, "%i", pProperty.???? ); //What for uint64?
VariantClear( &pProperty );
}
感谢
Thanks
推荐答案
这篇关于C ++ WMI UINT64问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!