• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 405
  • Last Modified:

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

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?
1 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...


Featured Post

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now