Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IPortableDevice::Content method

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

Syntax


HRESULT Content(
  [out] 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 value

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

Return codeDescription
S_OK

The method succeeded.

E_POINTER

The ppContent argument was a NULL pointer.

 

Examples



// 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

PortableDeviceApi.h

Library

PortableDeviceGUIDs.lib

See also

Adding a Resource to an Object
Enumerating Content
IPortableDevice Interface
Moving Content on the Device
Retrieving an Object Identifier from a Persistent Unique Identifier
Retrieving Properties for Multiple Objects
Retrieving the Rendering Capabilities Supported by a Device
Setting Properties for a Single Object
Setting Properties for Multiple Objects

 

 

Community Additions

Show:
© 2017 Microsoft