IWMDMDevice::GetManufacturer
The GetManufacturer method retrieves the name of the manufacturer of the device.
Syntax
HRESULT GetManufacturer(LPWSTRpwszName,UINTnMaxChars);
Parameters
pwszName
[out] Pointer to a wide-character, null-terminated string specifying the manufacturer's name. The buffer must be allocated and released by the caller.
nMaxChars
[in] Integer specifying the maximum number of characters that can be copied to pwszName, including the termination character.
Return Values
The method returns an HRESULT. All the interface methods in Windows Media Device Manager can return any of the following classes of error codes:
- Standard COM error codes
- Windows error codes converted to HRESULT values
- Windows Media Device Manager error codes
For an extenstive list of possible error codes, see Error Codes.
Possible values include, but are not limited to, those in the following table.
Return code | Description |
S_OK | The method succeeded. |
E_INVALIDARG | The pwszName parameter is an invalid or NULL pointer. |
WMDM_E_NOTSUPPORTED | The device does not have a manufacturer's name. |
WMDM_E_BUFFERTOOSMALL | The buffer specified is too small for the return string. Check nMaxChars for the required buffer size. |
E_FAIL | An unspecified error occurred. |
Example Code
The following C++ code retrieves the device manufacturer.
// Print the device manufacturer.
const UINT MAX_CHARS = 100;
rWCHAR manufacturer[MAX_CHARS];
hr = pIWMDMDevice->GetManufacturer((LPWSTR)&manufacturer, MAX_CHARS);
if (hr == S_OK)
// TODO: Display the manufacturer string.
Requirements
Header: Defined in mswmdm.h.
Library: mssachlp.lib
See Also