Click here to Skip to main content
16,012,168 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to know contents on a ftp server has changed since last visit Pin
Sebastian Schneider8-Feb-04 21:59
Sebastian Schneider8-Feb-04 21:59 
QuestionHow to import registry information to an access database Pin
aimanm8-Feb-04 17:37
aimanm8-Feb-04 17:37 
AnswerRe: How to import registry information to an access database Pin
David Crow9-Feb-04 5:53
David Crow9-Feb-04 5:53 
QuestionWebview or not? Pin
Prakash Nadar8-Feb-04 17:19
Prakash Nadar8-Feb-04 17:19 
GeneralCHtmlEditView Pin
VS Palani8-Feb-04 17:09
VS Palani8-Feb-04 17:09 
GeneralMFC release mode, list control & bitmaps Pin
User 5838528-Feb-04 16:43
User 5838528-Feb-04 16:43 
GeneralHelp with WMI Pin
Badut8-Feb-04 16:18
Badut8-Feb-04 16:18 
GeneralRe: Help with WMI Pin
David Crow9-Feb-04 6:06
David Crow9-Feb-04 6:06 
Here's one way:

HRESULT                 hr;
_variant_t              v;
ULONG                   ulReturned;
DWORD                   dwAuthLevel;
IWbemLocator            *pLocator;
IWbemServices           *pService = NULL;
IEnumWbemClassObject    *pEnum = NULL;
IWbemClassObject        *pClass;
 
hr = CoCreateInstance(CLSID_WbemLocator, 0, CLSCTX_INPROC_SERVER, IID_IWbemLocator, (LPVOID *) &pLocator);
if (S_OK == hr)
{
    hr = pLocator->ConnectServer(_bstr_t(L"root\\cimv2"), NULL, NULL, NULL, NULL, 0, NULL, &pService);
    if (WBEM_S_NO_ERROR == hr)
    {
        hr = CoQueryProxyBlanket(pService, NULL, NULL, NULL, &dwAuthLevel, NULL, NULL, NULL);
        hr = CoSetProxyBlanket(pService, RPC_C_AUTHN_DEFAULT, RPC_C_AUTHZ_NONE, NULL, dwAuthLevel, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE);
 
        hr = pService->CreateInstanceEnum(_bstr_t("Win32_Baseboard"), WBEM_FLAG_RETURN_IMMEDIATELY | WBEM_FLAG_FORWARD_ONLY, NULL, &pEnum);
        if (WBEM_S_NO_ERROR == hr)
        {
            do
            {
                hr = pEnum->Next(WBEM_INFINITE, 1, &pClass, &ulReturned);
                if (WBEM_S_NO_ERROR == hr)
                {
                    hr = pClass->Get(L"Caption", 0, &v, NULL, NULL);
                    if (VT_NULL != v.vt)
                        TRACE("Caption = %S\n", V_BSTR(&v));                            
                
                    hr = pClass->Get(L"ConfigOptions", 0, &v, NULL, NULL);
                    if (VT_NULL != v.vt)
                    {
                        LONG lBound;
                        BSTR Value;
                        SafeArrayGetUBound(V_ARRAY(&v), 1, &lBound);
                        while (lBound >= 0)
                        {
                            SafeArrayGetElement(V_ARRAY(&v), &lBound, &Value);
                            TRACE("ConfigOptions[%u] = %S\n", lBound, Value);
                            lBound--;
                        }
                    }
 
                    hr = pClass->Get(L"Depth", 0, &v, NULL, NULL);
                    if (VT_NULL != v.vt)
                        TRACE("Depth = %f\n", V_R4(&v));
 
                    pClass->Release();
                }
            } while (WBEM_S_NO_ERROR == hr);
 
            pEnum->Release();
        }
 
        pService->Release();
    }
 
    pLocator->Release();
}



A rich person is not the one who has the most, but the one that needs the least.
GeneralSilly little template question Pin
Ravi Bhavnani8-Feb-04 13:51
professionalRavi Bhavnani8-Feb-04 13:51 
GeneralRe: Silly little template question Pin
Tim Smith8-Feb-04 14:56
Tim Smith8-Feb-04 14:56 
GeneralRe: Silly little template question Pin
Ravi Bhavnani8-Feb-04 15:05
professionalRavi Bhavnani8-Feb-04 15:05 
GeneralRe: Silly little template question Pin
Taka Muraoka8-Feb-04 16:24
Taka Muraoka8-Feb-04 16:24 
GeneralRe: Silly little template question Pin
Ravi Bhavnani9-Feb-04 2:02
professionalRavi Bhavnani9-Feb-04 2:02 
GeneralRe: Silly little template question Pin
Nemanja Trifunovic8-Feb-04 18:29
Nemanja Trifunovic8-Feb-04 18:29 
GeneralRe: Silly little template question Pin
Ravi Bhavnani9-Feb-04 2:00
professionalRavi Bhavnani9-Feb-04 2:00 
GeneralCString to unsigned long Pin
Irish_GUI8-Feb-04 13:50
Irish_GUI8-Feb-04 13:50 
GeneralRe: CString to unsigned long Pin
Ravi Bhavnani8-Feb-04 14:30
professionalRavi Bhavnani8-Feb-04 14:30 
GeneralJpystick in a MFC Program Pin
Grahamfff8-Feb-04 10:22
Grahamfff8-Feb-04 10:22 
GeneralNetwork design question Pin
Madmaximus8-Feb-04 7:15
Madmaximus8-Feb-04 7:15 
QuestionHow do I call a function from Cmainframe in CSampleView? Pin
Schniddel8-Feb-04 6:34
Schniddel8-Feb-04 6:34 
AnswerRe: How do I call a function from Cmainframe in CSampleView? Pin
Ravi Bhavnani8-Feb-04 14:33
professionalRavi Bhavnani8-Feb-04 14:33 
GeneralMFC question Pin
Dev5788-Feb-04 5:19
Dev5788-Feb-04 5:19 
GeneralRe: MFC question Pin
valikac8-Feb-04 6:20
valikac8-Feb-04 6:20 
GeneralRe: MFC question Pin
Dev5788-Feb-04 7:19
Dev5788-Feb-04 7:19 
GeneralRe: MFC question Pin
Nick Parker8-Feb-04 11:14
protectorNick Parker8-Feb-04 11:14 

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.