AudRecordLib
Classes | Namespaces | Functions
AudRecordCLI/Error.h File Reference

Hosts declarations for error and exception related functions. More...

#include <boost/type_traits/is_same.hpp>
#include <boost/type_traits/remove_pointer.hpp>

Go to the source code of this file.

Classes

class  AudRecordCLI::AudRecordException

Namespaces

namespace  AudRecordCLI

Functions

template<class Args >
BOOL GetModuleMessage (HMODULE hMod, DWORD messageId, String^ &errorText, Args *args)
String^ GetModuleString (DWORD stringId)
BOOL GetModuleMessage (HMODULE hMod, DWORD messageId, String^ &errorText)
void ThrowExceptionIfRequired (HRESULT hr)
String^ FindErrorString (HRESULT hr)

Detailed Description

Hosts declarations for error and exception 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
template<class Args >
BOOL GetModuleMessage ( HMODULE  hMod,
DWORD  messageId,
String^ &  errorText,
Args *  args 
)

Retrieves a message string from a module or the system message table

Template Parameters:
ArgsType of the additional arguments, can be va_list or DWORD_PTR
Parameters:
hModModule to search for the message in, or NULL for the system
messageIdMessage to lookup
[out]errorTextThe retrieved error text
argsThe arguments to insert, no substitution is done if this is NULL
Returns:
Nonzero if the message was found, zero otherwise
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