coolb...@gmail.com
unread,Feb 10, 2016, 11:48:39 AM2/10/16You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi,
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..."
pinstToken->QueryInterface(IID_IUnknown, (void**)&pUnknown);
SafeArrayPutElement(psaTokens, &idx, pUnknown);
CComVariant var;
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.
-
Balu