Share via


IPortableDevice::Content

banner art

Previous Next

IPortableDevice::Content

The Content method retrieves an interface that you can use to access objects on a device.

Syntax

  HRESULT Content(
  IPortableDeviceContent**  ppContent
);

Parameters

ppContent

[out]  Address of a variable that receives a pointer to an IPortableDeviceContent interface that is used to access the content on a device. The caller must release this interface when it is done with it.

Return Values

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK The method succeeded.
E_POINTER The ppContent argument was a NULL pointer.

Example Code

// Assume IPortableDevice* pDevice has been CoCreated and opened
{
    HRESULT                 hr       = S_OK;
    IPortableDeviceContent* pContent = NULL;

    hr = pDevice->Content(&pContent);
    if (SUCCEEDED(hr))
    {
        // Perform IPortableDeviceContent operations here...
    }
    else
    {
        // Failed to get IPortableDeviceContent from IPortableDevice
    }

    // Release the IPortableDeviceContent interface when finished
    if (pContent)
    {
        pContent->Release();
        pContent = NULL;
    }
}

Requirements

Header: Defined in PortableDeviceApi.h

Library: PortableDeviceGUIDs.lib

See Also

Previous Next