retreiving the return value from the EnableStatic() method of Win32_NetworkAdapterConfig class

Posted on 2005-05-12
Last Modified: 2013-12-03
quick question

I am using EnableStatic to set the ip and it works. All i need now is to get the return value. Below is the function call:

hr = pNamespace->ExecMethod(InstancePath, methodName_setDhcp, 0, NULL,pInInstDHCP, &pOutInst, NULL);

now pOutInst is a IWbemClassObject. To get the data is pointing to i am using the Get property something like this:

pOutInst ->Get() but i am not quite sure as to what the first parameter should be since the EnableStatic needs to return a uint32. If i make it 0 i do not get a thing back.
Any ideas how to go about retreiving the retun value from the object returned?
Question by:aleks_grid
    1 Comment
    LVL 8

    Accepted Solution

    you need to use
    IWbemClassObject::Get method to get the return value.

    CComVariant varReturnValue;
    hr = spOutParams->Get(L"ReturnValue", 0, &varReturnValue, 0, 0);

    for more info, refer...


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
    This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
    This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now