Click here to Skip to main content
16,011,743 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: in vc++ Pin
prasad_som24-Jan-07 17:53
prasad_som24-Jan-07 17:53 
AnswerRe: in vc++ Pin
Michael Dunn24-Jan-07 17:53
sitebuilderMichael Dunn24-Jan-07 17:53 
Questioncan any body help me in win32 Pin
amitmistry_petlad 24-Jan-07 17:36
amitmistry_petlad 24-Jan-07 17:36 
AnswerRe: can any body help me in win32 Pin
Blake Miller25-Jan-07 8:53
Blake Miller25-Jan-07 8:53 
GeneralRe: can any body help me in win32 Pin
amitmistry_petlad 28-Jan-07 19:35
amitmistry_petlad 28-Jan-07 19:35 
GeneralRe: can any body help me in win32 Pin
Blake Miller29-Jan-07 4:04
Blake Miller29-Jan-07 4:04 
AnswerRe: can any body help me in win32 Pin
Hamid_RT25-Jan-07 19:45
Hamid_RT25-Jan-07 19:45 
QuestionUsing WMI to get SMART data from my harddrives problem Pin
Outback199924-Jan-07 14:46
Outback199924-Jan-07 14:46 
I have the following code which is suppose to get the PredictFailure member from the MSStorageDriver_FailurePredictStatus class. This code SEEMS to work, but only ever returns one value when I have two drives.

I've tested the pEnumObject itterating by changing using other class types, (for example getting the Model attribute from Win32_DiskDrive - this loops and returns two drive names)

Can anyone offer why I don't get back two failure status codes?

Thanks,
Mark

HRESULT hRes;
BSTR strQuery = (L"Select * from MSStorageDriver_FailurePredictStatus");
BSTR strQL = (L"WQL");
hRes = pWbemServices->ExecQuery(strQL, strQuery,WBEM_FLAG_RETURN_IMMEDIATELY,NULL,&pEnumObject);

if(hRes != S_OK)
{
MessageBox("Could not execute Query");
return;
}

ULONG uCount = 1, uReturned;
IWbemClassObject * pClassObject = NULL;

hRes = pEnumObject->Reset();

if(hRes != S_OK)
{
MessageBox("Could not Enumerate");
return;
}
while (pEnumObject)
{
hRes = pEnumObject->Next(WBEM_INFINITE,uCount, &pClassObject, &uReturned);

if (0 == uReturned)
break;

if(hRes != S_OK)
{
MessageBox("Could not Enumerate");
return;
}

VARIANT v;
BSTR strClassProp = SysAllocString(L"PredictFailure");
hRes = pClassObject->Get(strClassProp, 0, &v, 0, 0);
if(hRes != S_OK)
{
MessageBox("Could not Get Value");
//return;
}

SysFreeString(strClassProp);

_bstr_t bstrPath = &v; //Just to convert BSTR to ANSI
char* strPath=(char*)bstrPath;


if (SUCCEEDED(hRes))
MessageBox(strPath);
else
MessageBox("Error in getting object");

VariantClear( &v );
}
pIWbemLocator->Release();
pWbemServices->Release();
pEnumObject->Release();
pClassObject->Release();
CoUninitialize();
Questionstrings Pin
zoobiskuit24-Jan-07 14:41
zoobiskuit24-Jan-07 14:41 
AnswerWrong way! [modified] Pin
Mohammad Rastkar24-Jan-07 15:40
Mohammad Rastkar24-Jan-07 15:40 
QuestionRe: strings Pin
David Crow25-Jan-07 3:12
David Crow25-Jan-07 3:12 
Questionreading text into CString Pin
RalfPeter24-Jan-07 12:04
RalfPeter24-Jan-07 12:04 
AnswerRe: reading text into CString Pin
toxcct24-Jan-07 12:18
toxcct24-Jan-07 12:18 
AnswerRe: reading text into CString Pin
Mahesh Kulkarni24-Jan-07 17:57
Mahesh Kulkarni24-Jan-07 17:57 
GeneralRe: reading text into CString Pin
toxcct25-Jan-07 1:15
toxcct25-Jan-07 1:15 
GeneralRe: reading text into CString Pin
RalfPeter25-Jan-07 10:39
RalfPeter25-Jan-07 10:39 
GeneralRe: reading text into CString Pin
toxcct25-Jan-07 10:42
toxcct25-Jan-07 10:42 
GeneralRe: reading text into CString Pin
RalfPeter25-Jan-07 10:40
RalfPeter25-Jan-07 10:40 
GeneralRe: reading text into CString Pin
Hamid_RT25-Jan-07 19:45
Hamid_RT25-Jan-07 19:45 
Questionquestion about setting cursor on Cstatic Pin
abstar24-Jan-07 11:44
abstar24-Jan-07 11:44 
AnswerRe: question about setting cursor on Cstatic Pin
toxcct24-Jan-07 12:19
toxcct24-Jan-07 12:19 
AnswerRe: question about setting cursor on Cstatic Pin
Stephen Hewitt24-Jan-07 13:10
Stephen Hewitt24-Jan-07 13:10 
GeneralRe: question about setting cursor on Cstatic Pin
abstar24-Jan-07 14:54
abstar24-Jan-07 14:54 
GeneralRe: question about setting cursor on Cstatic Pin
Stephen Hewitt24-Jan-07 15:18
Stephen Hewitt24-Jan-07 15:18 
GeneralRe: question about setting cursor on Cstatic Pin
Hamid_RT25-Jan-07 19:23
Hamid_RT25-Jan-07 19:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.