Feb 10, 2016, 11:48:39 AM2/10/16
I am trying to use the WMI removeResourceSetting() method of Msvm_VirtualSystemManagementService class to remove the attached disk. To use this method, the first parameter is array of references to instances of the CIM_ResourceAllocationSettingData class.
Here is snippet of code:
saBounds.cElements = 1;
saBounds.lLbound = 0;
psaTokens = SafeArrayCreate(VT_UNKNOWN, 1, &saBounds);
//pinstToken is CComPtr<IWbemClassObject>
//pinstToken is obtained from the query to "Select * from //Mvsm_ResourceAllocationSettingData where..."
SafeArrayPutElement(psaTokens, &idx, pUnknown);
var.vt = VT_ARRAY | VT_UNKNOWN | VT_BYREF;
var.parray = psaTokens;
if we pass on the var parameter to wbem put(), the method always fails with type mismatch.
What should be the correct variant type that needs to be passed ?
Thanks in advance.