Classes | Functions

Microsoft Windows Helper Library

Very basic routines and classes for working with Windows APIs. More...

Classes

class  COM_ptr< T >
 COM_ptr<T>: smart pointer to automatically de-reference COM objects. More...

Functions

template<class X >
 COM_ptr::COM_ptr (IN const COM_ptr< X > &from) throw ()
 COM_ptr::~COM_ptr (void) throw ()
T * COM_ptr::operator-> (void) throw ()
const T * COM_ptr::operator-> (void) const throw ()
 COM_ptr::operator T * (void) throw ()
 COM_ptr::operator const T * (void) const throw ()
 COM_ptr::operator bool (void) throw ()
 COM_ptr::operator bool (void) const throw ()
bool COM_ptr::operator! (void) const throw ()
 COM_ptr::operator LPVOID * (void) throw ()
const COM_ptr< T > & COM_ptr::operator= (IN T *pT) throw ()
template<class X >
const COM_ptr< T > & COM_ptr::operator= (IN COM_ptr< X > &from) throw ()



void checkRpcStatus (IN RPC_STATUS rpc_status) throw ()
 helper method to print out information about a particular RPC_STATUS code.
void checkHresult (IN HRESULT hr) throw ()
 helper method to print out information about a particular HRESULT code.
void writeGuid (IO std::ostream &stream, IN const GUID &guid)
 writes an ANSI version of the GUID to the given stream
std::ostream & operator<< (IO std::ostream &stream, IN const GUID &guid)
const char * getGuidString (IN const GUID &guid, IO char *buffer, IN int bufsize)
 gets GUID as a string and copies as much of it as will fit into the specified buffer.
#define RPC_VERIFY(exp, rpc_status, msg)
#define HRESULT_VERIFY(exp, hr, msg)

Detailed Description

Very basic routines and classes for working with Windows APIs.


Define Documentation

#define RPC_VERIFY (   exp,
  rpc_status,
  msg 
)
Value:
if (!(exp)) {                                                   \
                DPRINTF("Windows RPC call failed!");                    \
                checkRpcStatus(rpc_status);                             \
                ASSERT_THROW(false && (exp), msg);                      \
        }

Definition at line 62 of file wave-windows.h.

#define HRESULT_VERIFY (   exp,
  hr,
  msg 
)
Value:
if (!(exp)) {                                                   \
                DPRINTF("Failed windows hresult check!");               \
                checkHresult(hr);                                       \
                ASSERT_THROW(false && (exp), msg);                      \
        }

Definition at line 77 of file wave-windows.h.


Function Documentation

void checkRpcStatus ( IN RPC_STATUS  rpc_status  )  throw ()

helper method to print out information about a particular RPC_STATUS code.

Definition at line 58 of file wave-windows.cpp.

void checkHresult ( IN HRESULT  hr  )  throw ()

helper method to print out information about a particular HRESULT code.

Note that this method is often useless since most Windows APIs also define their own (usually redundant) error codes. So you will have to build your own API-specific error code inspection routine, on top of this generic one.

Definition at line 76 of file wave-windows.cpp.

void writeGuid ( IO std::ostream &  stream,
IN const GUID &  guid 
)

writes an ANSI version of the GUID to the given stream

Definition at line 97 of file wave-windows.cpp.

std::ostream& operator<< ( IO std::ostream &  stream,
IN const GUID &  guid 
) [inline]

Definition at line 90 of file wave-windows.h.

const char* getGuidString ( IN const GUID &  guid,
IO char *  buffer,
IN int  bufsize 
)

gets GUID as a string and copies as much of it as will fit into the specified buffer.

Use 32+ chars to be safe. Returns a pointer to the buffer as a convenience.

Definition at line 110 of file wave-windows.cpp.

template<class T>
template<class X >
COM_ptr< T >::COM_ptr ( IN const COM_ptr< X > &  from  )  throw () [inline, inherited]

Definition at line 125 of file wave-windows.h.

template<class T>
COM_ptr< T >::~COM_ptr ( void   )  throw () [inline, inherited]

Definition at line 128 of file wave-windows.h.

template<class T>
T* COM_ptr< T >::operator-> ( void   )  throw () [inline, inherited]

Definition at line 131 of file wave-windows.h.

template<class T>
const T* COM_ptr< T >::operator-> ( void   )  const throw () [inline, inherited]

Definition at line 136 of file wave-windows.h.

template<class T>
COM_ptr< T >::operator T * ( void   )  throw () [inline, inherited]

Definition at line 141 of file wave-windows.h.

template<class T>
COM_ptr< T >::operator const T * ( void   )  const throw () [inline, inherited]

Definition at line 145 of file wave-windows.h.

template<class T>
COM_ptr< T >::operator bool ( void   )  throw () [inline, inherited]

Definition at line 150 of file wave-windows.h.

template<class T>
COM_ptr< T >::operator bool ( void   )  const throw () [inline, inherited]

Definition at line 154 of file wave-windows.h.

template<class T>
bool COM_ptr< T >::operator! ( void   )  const throw () [inline, inherited]

Definition at line 158 of file wave-windows.h.

template<class T>
COM_ptr< T >::operator LPVOID * ( void   )  throw () [inline, inherited]

Definition at line 162 of file wave-windows.h.

template<class T>
const COM_ptr<T>& COM_ptr< T >::operator= ( IN T *  pT  )  throw () [inline, inherited]

Definition at line 167 of file wave-windows.h.

template<class T>
template<class X >
const COM_ptr<T>& COM_ptr< T >::operator= ( IN COM_ptr< X > &  from  )  throw () [inline, inherited]

Definition at line 173 of file wave-windows.h.