Click here to Skip to main content
15,924,367 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Do I always need a function that's executed by only one thread to initialize synchronization objetcs? Pin
Blake V. Miller24-Nov-05 9:09
Blake V. Miller24-Nov-05 9:09 
QuestionExecute and retrieve data from console Pin
schemp9812-Oct-05 5:11
schemp9812-Oct-05 5:11 
QuestionRe: Execute and retrieve data from console Pin
David Crow12-Oct-05 6:22
David Crow12-Oct-05 6:22 
AnswerRe: Execute and retrieve data from console Pin
schemp9812-Oct-05 7:09
schemp9812-Oct-05 7:09 
GeneralRe: Execute and retrieve data from console Pin
Rage12-Oct-05 7:26
professionalRage12-Oct-05 7:26 
GeneralRe: Execute and retrieve data from console Pin
David Crow12-Oct-05 7:33
David Crow12-Oct-05 7:33 
QuestionGetting IP Address through WMI Pin
qrverona12-Oct-05 4:23
qrverona12-Oct-05 4:23 
AnswerRe: Getting IP Address through WMI Pin
David Crow12-Oct-05 6:31
David Crow12-Oct-05 6:31 
qrverona wrote:
I have a problem while accessing to the "IPAddress" data managed by the Win32_NetworkAdapterConfiguration WMI class.

I would employ something like:

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_NetworkAdapterConfiguration"), 
                                          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"IPAddress", 0, &v, NULL, NULL);
                    if (v.vt != VT_NULL)
                        ...
 
                    pClass->Release();
                }
            } while (WBEM_S_NO_ERROR == hr);
        }
    }
}



"One must learn from the bite of the fire to leave it alone." - Native American Proverb


QuestionApplication getting stuck because of load ? Pin
Amarelia12-Oct-05 3:25
Amarelia12-Oct-05 3:25 
AnswerRe: Application getting stuck because of load ? Pin
John M. Drescher12-Oct-05 5:08
John M. Drescher12-Oct-05 5:08 
AnswerRe: Application getting stuck because of load ? Pin
Bob Stanneveld12-Oct-05 6:01
Bob Stanneveld12-Oct-05 6:01 
GeneralRe: Application getting stuck because of load ? Pin
Amarelia12-Oct-05 22:17
Amarelia12-Oct-05 22:17 
QuestionRe: Application getting stuck because of load ? Pin
David Crow13-Oct-05 3:05
David Crow13-Oct-05 3:05 
AnswerRe: Application getting stuck because of load ? Pin
Amarelia13-Oct-05 3:09
Amarelia13-Oct-05 3:09 
GeneralRe: Application getting stuck because of load ? Pin
David Crow13-Oct-05 3:38
David Crow13-Oct-05 3:38 
QuestionApplication getting stuck because of load ? Pin
Amarelia12-Oct-05 3:21
Amarelia12-Oct-05 3:21 
QuestionApplication getting stuck because of load ? Pin
Amarelia12-Oct-05 3:21
Amarelia12-Oct-05 3:21 
QuestionCBitmapButton Transparency Pin
NewVCbie12-Oct-05 3:18
sussNewVCbie12-Oct-05 3:18 
QuestionWebBrowser Problem, Please. Pin
GhostEx12-Oct-05 2:47
GhostEx12-Oct-05 2:47 
QuestionTerminate sqlservr.exe process Pin
sirtimid12-Oct-05 2:23
sirtimid12-Oct-05 2:23 
QuestionRe: Terminate sqlservr.exe process Pin
David Crow12-Oct-05 3:12
David Crow12-Oct-05 3:12 
AnswerRe: Terminate sqlservr.exe process Pin
sirtimid12-Oct-05 22:02
sirtimid12-Oct-05 22:02 
QuestionRe: Terminate sqlservr.exe process Pin
David Crow13-Oct-05 3:02
David Crow13-Oct-05 3:02 
AnswerRe: Terminate sqlservr.exe process Pin
Tim Smith12-Oct-05 3:54
Tim Smith12-Oct-05 3:54 
QuestionIncrease Text speed in CBanner class ? Pin
Amarelia12-Oct-05 2:13
Amarelia12-Oct-05 2:13 

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.