次の方法で共有


IWMDMLogger::LogDword

banner art

The LogDword method logs a DWORD value to the current log file. A carriage return and line feed are added to each log entry.

Syntax

HRESULT LogDword(DWORDdwFlags,LPSTRpszSrcName,LPSTRpszLogFormat,DWORDdwLog);

Parameters

dwFlags

[in]  Flags that control the way a string is logged. This parameter is a combination of one or more of the following values.

Value Description
WMDM_LOG_SEV_INFO Tag the log entry as informational.
WMDM_LOG_SEV_WARN Tag the log entry as a warning.
WMDM_LOG_SEV_ERROR Tag the log entry as an error.
WMDM_LOG_NOTIMESTAMP Do not include a time stamp on the log entry. Time stamps are in ISO format minus the time-zone information.

pszSrcName

[in]  Optional pointer to a string containing the name of the module that is making the log entry.

pszLogFormat

[in]  Pointer to a string that specifies the format of the log string. This string is of the same form as the format string for the printf function.

dwLog

[in]  DWORD value to log.

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 extensive 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 A parameter is invalid.
E_ACCESSDENIED An error occurred while accessing the log file.
E_OUTOFMEMORY There is not enough memory to complete this logging operation.
E_ABORT The method timed out while trying to get exclusive access to the log file.
E_FAIL An unspecified error occurred.

Example Code

// Send the file and metadata.
    hr = pStgCtl3->Insert3(
        flags,
        WMDM_FILE_ATTR_FOLDER, // The current storage is a folder.
        const_cast<WCHAR*>(pwszFileName), // Source file.
        NULL, // Destination file name.
        pOperation, // Null to allow the SDK to read the file; non-null to 
                    // present raw data bytes to the SDK.
        pProgress, // Interface to send simple progress notifications.
        pMetadata, // IWMDMMetaData interface previously created and filled.
        NULL, 
        &pNewStorage);
    if(FAILED(hr))
        m_pLogger->LogDword(WMDM_LOG_SEV_ERROR, NULL, 
            "Error calling Insert3 in mySendFile: %lX", hr);

Requirements

Header: Defined in wmdmlog.idl.

Library: mssachlp.lib

See Also