IWDTF::DeviceDepot property
The DeviceDepot property retrieves the instance of the IDeviceDepot interface.
This property is read-only.
Syntax
HRESULT get_DeviceDepot(
[out, retval] IDeviceDepot **pVal
);
Property value
The address of the variable that will receive the interface.
Error codes
DeviceDepot returns a standard HRESULT value.
Remarks
The following code example demonstrates how to get the DeviceDepot property from the WDTF object.
VBScript
Dim WDTF ' WDTF Object
Dim DeviceDepot ' DeviceDepot Object
'
' Create WDTF object
'
Set WDTF = CreateObject("WDTF.WDTF")
If WDTF Is Nothing Then
WScript.Echo "Error instantiating WDTF object"
End If
'
' Get DeviceDepot
'
Set DeviceDepot = WDTF.DeviceDepot
C++
HRESULT hr = S_OK; // HRESULT returned by methods, properties, and COM APIs
IWDTF* pWDTF = NULL; // WDTF object
IDeviceDepot* pDeviceDepot = NULL; // DeviceDepot object
//
// Initialize COM runtime
//
hr = CoInitialize(NULL);
if(FAILED(hr))
{
_tprintf(TEXT("\nFailed to initialize COM Runtime. Error: 0x%x"), hr);
goto Cleanup;
}
//
// Create WDTF Object
//
hr = CoCreateInstance( CLSID_WDTF, // WDTF Class ID
NULL, // Outer Unknown for Aggregation
CLSCTX_INPROC_SERVER, // Create In Process
__uuidof(IWDTF), // IWDTF interface ID
reinterpret_cast<void**>(&pWDTF) // Address for WDTF object
);
if(FAILED(hr))
{
_tprintf(_T("\nFailed to create instance of WDTF object. Error: 0x%x"), hr);
goto Cleanup;
}
//
// Get DeviceDepot for querying and fetching the ITargets objects
//
hr = pWDTF->get_DeviceDepot(&pDeviceDepot);
if(FAILED(hr))
{
_tprintf(_T("\nFailed to get DeviceDepot Object from WDTF. Error: 0x%x"), hr);
goto Cleanup;
}
See also
Send comments about this topic to Microsoft
Build date: 1/12/2012