AudRecordLib
Namespaces | Functions
AudRecordCLI/Error.cpp File Reference

Implements exceptions and error related functions. More...

#include "stdafx.h"
#include "error.h"

Namespaces

namespace  AudRecordCLI

Functions

void ThrowExceptionIfRequired (HRESULT hr)
BOOL GetModuleMessage (HMODULE hMod, DWORD messageId, String^ &errorText)
String^ GetModuleString (DWORD stringId)
String^ FindErrorString (HRESULT hr)

Detailed Description

Implements exceptions and error related functions.


Function Documentation

String ^ FindErrorString ( HRESULT  hr)

Searches the system message table for an error string that corresponds to a certain HRESULT. If that fails it searches the Windows Media error string dll wmerror.dll

Parameters:
hrThe hresult to message-ise
Returns:
The message string if the hresult was found, or nullptr of not
BOOL GetModuleMessage ( HMODULE  hMod,
DWORD  messageId,
String^ &  errorText 
)

Searches a module's message table for a string matching a certain id

Parameters:
hModThe module whose message table is to be searched
messageIdThe message id to find
[out]errorTextThe message contents if the message is found
Returns:
Whether the message was found or not
String ^ GetModuleString ( DWORD  stringId)

Finds a string in AudRecordCLI's message resources and creates a managed version of it.

Parameters:
stringIdThe identifier of the message
Returns:
A managed version of the module string or nullptr if its not found
void ThrowExceptionIfRequired ( HRESULT  hr)

Maps a hresult to the closest managed exception class or to a AudRecordException if no mapping is found

Parameters:
hrThe hresult to map
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Defines