Serial Framework C++ Edition
Classes | Typedefs | Enumerations | Functions | Variables
wclCommon Namespace Reference

Classes

class  CwclAudioCategoryMessage
 The Audio Switcher Category message object. More...
 
class  CwclBluetoothCategoryMessage
 The Bluetooth Category Message base class. More...
 
class  CwclConnectionCategoryMessage
 The Connection Category Message base class. More...
 
class  CwclCustomMemoryStream
 The base class for memory streams. More...
 
class  CwclFileStream
 The class represents a file stream. More...
 
class  CwclHandleStream
 The base class for handle based streams. More...
 
class  CwclHardwareChangeMessage
 The Hardware Changed message is broadcast to all subscribers when changes in the hardware configuration have been detected. The message ID is wclCommon::WCL_MSG_ID_SYS_HARDWARE_CHANGED. More...
 
class  CwclIrDACategoryMessage
 The IrDA Category Message base class. More...
 
class  CwclKinectCategoryMessage
 The Kinect Category Message base class. More...
 
class  CwclMemoryStream
 The memory stream. More...
 
class  CwclMessage
 The message object. More...
 
class  CwclMessageBroadcaster
 The message broadcaster manages broadcast messages between subscribers (message receivers subscribed for broadcast messages). Also the message broadcaster monitors changes in the hardware configuration and notifies subscribers about the changes. More...
 
class  CwclMessageReceiver
 The message receiver object. More...
 
class  CwclOsVersion
 The class provides information about OS version. More...
 
class  CwclPowerEventsMonitor
 The class allows an application to receive power state changes notifications. More...
 
class  CwclPowerStateChangeMessage
 The Power State Changed message is broadcast to all subscribers when changes in the power state have been detected. The message ID is WCL_MSG_ID_SYS_POWER_STATE_CHANGED. More...
 
class  CwclSerialCategoryMessage
 The Serial Category Message base class. More...
 
class  CwclStream
 The base class for WCL streams. More...
 
class  CwclStreamAdapter
 The class implements the IStream interface on a CwclStream object. More...
 
class  CwclSystemCategoryMessage
 The system category message base class. More...
 
class  CwclThread
 The class allows to use WCL components in threads, console and service applications. More...
 
class  CwclThreadSignalMessage
 The WCL Thread Signal message. More...
 
class  CwclThreadSynchronizeMessage
 The WCL Thread Synchronize message. More...
 
class  CwclUsbCategoryMessage
 The USB Category Message base class. More...
 
class  CwclUserDefinedCategoryMessage
 The base class for user-defined messages. More...
 
class  CwclWiFiCategoryMessage
 The WiFi Category Message base class. More...
 
class  CwclWiiCategoryMessage
 The Wii Remote Category Message base class. More...
 
class  wclECritical
 Critical exception. More...
 
class  wclEFileOpenFailed
 Failed to open file. More...
 
class  wclEInvalidArgument
 One or more arguments passed into constructor are invalid. More...
 
class  wclEOutOfMemory
 Not enough system memory. More...
 
class  wclException
 The base WCL exceptions class. More...
 

Typedefs

typedef std::wstring tstring
 Defines the string type as UNICODE string.
 

Enumerations

enum  wclMessageSynchronizationKind { skMessages , skThread , skApc }
 Message synchronization methods used to inter-threading synchronization and notification. More...
 
enum  wclWinVer {
  verUnknown = 1 , verWinXP = 2 , verWinVista = 3 , verWin7 = 4 ,
  verWin8 = 5 , verWin81 = 6 , verWin10 = 7 , verWin11 = 8
}
 Windows versions. More...
 
enum  wclSeekOrigin { soBeginning , soCurrent , soEnd }
 Stream origins. More...
 
enum  wclStreamOwnership { soReference , soOwned }
 The enumeration indicates whether a stream object should be freed by the object that uses it. More...
 
enum  wclPowerState { psResumeAutomatic , psResume , psSuspend , psUnknown }
 The enumeration defines the system power states. More...
 

Functions

HANDLE wclCreateMutex (const TCHAR *Name, const bool Unique, const bool Own=false)
 Creates a new mutex with given name.
 
bool wclGetErrorInfo (const int Error, tstring &Framework, tstring &Category, tstring &Constant, tstring &Description)
 Reads the error information.
 
bool wclGetErrorInfo (const tstring &FileName, const int Error, tstring &Framework, tstring &Category, tstring &Constant, tstring &Description)
 Reads the error information.
 
tstring wclUTF8Decode (const PCHAR lpszUTF8, const DWORD Len)
 Converts UTF8 string to WCL string.
 
tstring wclUTF8Decode (const PCHAR lpszUTF8)
 Converts UTF8 string to WCL string.
 
void wclUTF8Encode (const tstring &str, const PCHAR lpszUTF8, const DWORD dwUTF8Len)
 Converts WCL (UNICODE) string to UTF8 encoded string.
 
std::string wclUnicodeToAnsi (const std::wstring &s)
 Converts UNICODE string to ANSI string.
 
std::wstring wclAnsiToUnicode (const std::string &s)
 Converts ANSI string to UNICODE string.
 

Variables

const int WCL_E_SUCCESS = 0x00000000
 Operation completed with success.
 
const int WCL_E_BASE = 0x00010000
 The base error code for the WCL system/common errors.
 
const int WCL_E_INVALID_ARGUMENT = WCL_E_BASE + 0x0000
 One or more arguments passed into the method or function are invalid.
 
const int WCL_E_OUT_OF_MEMORY = WCL_E_BASE + 0x0001
 Out of system memory.
 
const int WCL_E_MR_BASE = WCL_E_BASE + 0x1000
 The base error code for the message receiver.
 
const int WCL_E_MR_CLOSED = WCL_E_MR_BASE + 0x0000
 A message receiver has already been closed or not opened.
 
const int WCL_E_MR_OPENED = WCL_E_MR_BASE + 0x0001
 A message receiver has already been opened.
 
const int WCL_E_MR_NOT_OPENED = WCL_E_MR_BASE + 0x0002
 A message receiver was not opened yet.
 
const int WCL_E_MR_UNABLE_SYNCHRONIZE = WCL_E_MR_BASE + 0x0003
 A message receiver can not synchronize threads and notify a "main" thread about new received message.
 
const int WCL_E_MR_UNABLE_REGISTER_SYNC_OBJ = WCL_E_MR_BASE + 0x0004
 A message receiver can not register for threads synchronization.
 
const int WCL_E_MR_UNABLE_CREATE_SYNC_OBJ = WCL_E_MR_BASE + 0x0005
 A message receiver can not create a thread synchronization object.
 
const int WCL_E_MR_SYNC_OBJ_NOT_CREATED = WCL_E_MR_BASE + 0x0006
 A thread synchronization object has not been created.
 
const int WCL_E_MB_BASE = WCL_E_BASE + 0x2000
 The base error code for the message broadcaster.
 
const int WCL_E_MB_RECEIVER_ALREADY_SUBSCRIBED = WCL_E_MB_BASE + 0x0000
 A message receiver has already been subscribed.
 
const int WCL_E_MB_RECEIVER_NOT_SUBSCRIBED = WCL_E_MB_BASE + 0x0001
 A message receiver has not been subscribed.
 
const int WCL_E_MB_CAN_NOT_INIT_HW_THREAD = WCL_E_MB_BASE + 0x0002
 The message broadcaster can not initialize the hardware monitoring thread.
 
const int WCL_E_MB_CAN_NOT_START_HW_THREAD = WCL_E_MB_BASE + 0x0003
 The message broadcaster can not start the hardware monitoring thread.
 
const int WCL_E_MB_UNABLE_CREATE_HW_OBJ = WCL_E_MB_BASE + 0x0004
 The message broadcaster can not create the hardware monitoring object.
 
const int WCL_E_MB_UNABLE_REGISTER_HW_NOTIFY = WCL_E_MB_BASE + 0x0005
 The message broadcaster can not register for hardware changes notifications.
 
const int WCL_E_MB_UNABLE_CREATE_MUTEX = WCL_E_MB_BASE + 0x0006
 The message broadcaster can not create a mutex synchronization object.
 
const int WCL_E_MB_NOT_CREATED = WCL_E_MB_BASE + 0x0007
 The message broadcaster was not created.
 
const int WCL_E_MB_REF_COUNT_ERROR = WCL_E_MB_BASE + 0x0008
 There is the error with the references counter.
 
const int WCL_E_MB_RUNNING = WCL_E_MB_BASE + 0x0009
 The messaging subsystem is already running.
 
const int WCL_E_MB_INVALID_SYNC_METHOD = WCL_E_MB_BASE + 0x000A
 Invalid or unknown synchronization method.
 
const int WCL_E_MB_WAIT_TIMEOUT = WCL_E_MB_BASE + 0x000B
 A timeout appeared during wait operation.
 
const int WCL_E_MB_WAIT_FAILED = WCL_E_MB_BASE + 0x000C
 Wait operation failed.
 
const int WCL_E_WINRT_BASE = WCL_E_BASE + 0x3000
 The base WinRT subsystem error code.
 
const int WCL_E_WINRT_UNABLE_CREATE_MUTEX = WCL_E_WINRT_BASE + 0x0000
 Unable to create synchronization mutex for WinRT control.
 
const int WCL_E_WINRT_UNABLE_LOAD_CORE_DLL = WCL_E_WINRT_BASE + 0x0001
 unable to load WinRT core DLL.
 
const int WCL_E_WINRT_UNABLE_LOAD_STRING_DLL = WCL_E_WINRT_BASE + 0x0002
 unable to load WinRT string DLL.
 
const int WCL_E_WINRT_INIT_FAILED = WCL_E_WINRT_BASE + 0x0003
 WinRT initialization failed.
 
const int WCL_E_WINRT_UNABLE_CREATE_STRING = WCL_E_WINRT_BASE + 0x0004
 Unable to create string.
 
const int WCL_E_WINRT_UNABLE_ACTIVATE_INSTANCE = WCL_E_WINRT_BASE + 0x0005
 Unable to active instance of the required class.
 
const int WCL_E_WINRT_UNABLE_CREATE_INTERFACE = WCL_E_WINRT_BASE + 0x0006
 Unable to create interface of the required class.
 
const int WCL_E_WINRT_ASYNC_OPERATION_FAILED = WCL_E_WINRT_BASE + 0x0007
 Failed to read asynchronous operation status.
 
const int WCL_E_WINRT_ASYNC_OPERATION_CANCELLED = WCL_E_WINRT_BASE + 0x0008
 An asynchronous operation canceled.
 
const int WCL_E_WINRT_ASYNC_OPERATION_ERROR = WCL_E_WINRT_BASE + 0x0009
 An asynchronous operation completed with error.
 
const int WCL_E_WINRT_DETACH_BUFFER_FAILED = WCL_E_WINRT_BASE + 0x000A
 Unable to detach raw buffer.
 
const int WCL_E_WINUSB_BASE = WCL_E_BASE + 0x4000
 The base error code for all WinUSB subsystem errors.
 
const int WCL_E_WINUSB_UNABLE_CREATE_MUTEX = WCL_E_WINUSB_BASE + 0x0000
 Unable create WinSUB subsystem synchronization mutex.
 
const int WCL_E_WINUSB_UNABLE_LOAD = WCL_E_WINUSB_BASE + 0x0001
 WinUSB subsystem is not available on your system.
 
const int WCL_E_WINUSB_NOT_LOADED = WCL_E_WINUSB_BASE + 0x0002
 WinUSB subsystem was not loaded.
 
const int WCL_E_WINUSB_UNEXPECTED = WCL_E_WINUSB_BASE + 0x0003
 Unknown or unexpected WinUSB error.
 
const int WCL_E_WINUSB_DEVICE_OPENED = WCL_E_WINUSB_BASE + 0x0004
 A WinUSB device is already opened.
 
const int WCL_E_WINUSB_DEVICE_CLOSED = WCL_E_WINUSB_BASE + 0x0005
 A WinUSB device is closed.
 
const int WCL_E_WINUSB_DEVICE_NOT_OPENED = WCL_E_WINUSB_BASE + 0x0006
 A WinUSB device is not opened.
 
const int WCL_E_WINUSB_OPEN_DEVICE_FAILED = WCL_E_WINUSB_BASE + 0x0007
 Unable to open specified WinUSB device.
 
const int WCL_E_WINUSB_INIT_DEVICE_FAILED = WCL_E_WINUSB_BASE + 0x0008
 Initialize WinUSB device failed.
 
const int WCL_E_WINUSB_CONTROL_TRANSFER_FAILED = WCL_E_WINUSB_BASE + 0x0009
 Control transfer failed.
 
const int WCL_E_WINUSB_READ_PIPE_FAILED = WCL_E_WINUSB_BASE + 0x000A
 Read data from pipe (endpoint) failed.
 
const int WCL_E_THREAD_BASE = WCL_E_BASE + 0x5000
 The base error code for all WCL thread errors.
 
const int WCL_E_THREAD_RUNNING = WCL_E_THREAD_BASE + 0x0000
 The thread is already running.
 
const int WCL_E_THREAD_UNABLE_CREATE_THREAD_INIT_EVENT = WCL_E_THREAD_BASE + 0x0001
 Unable to create thread initialization event.
 
const int WCL_E_THREAD_UNABLE_CREATE_THREAD = WCL_E_THREAD_BASE + 0x0002
 Unable to create thread.
 
const int WCL_E_THREAD_NOT_RUNNING = WCL_E_THREAD_BASE + 0x0003
 The thread is not running.
 
const int WCL_E_THREAD_INVALID_SYNCHRONIZATION = WCL_E_THREAD_BASE + 0x0004
 The synchronization method is not supported by the wclThread class.
 
const int WCL_E_THREAD_MESSAGE_REGISTRATION_FAILED = WCL_E_THREAD_BASE + 0x0005
 Unable to register thread message.
 
const int WCL_E_THREAD_WINDOW_CREATION_FAILED = WCL_E_THREAD_BASE + 0x0006
 Unable to create thread window.
 
const int WCL_E_THREAD_INITIALIZATION_FAILED = WCL_E_THREAD_BASE + 0x0007
 Thread user initialization failed.
 
const int WCL_E_THREAD_UNABLE_CREATE_THREAD_TERM_EVENT = WCL_E_THREAD_BASE + 0x0008
 Unable to create thread termination event.
 
const int WCL_E_THREAD_UNABLE_CREATE_THREAD_SYNC_EVENT = WCL_E_THREAD_BASE + 0x0009
 Unable to create thread synchronization event.
 
const int WCL_E_PEM_BASE = WCL_E_BASE + 0x6000
 The base error code for Power Events monitor error codes.
 
const int WCL_E_PEM_OPENED = WCL_E_PEM_BASE + 0x0000
 The power events monitor is already opened.
 
const int WCL_E_PEM_CLOSED = WCL_E_PEM_BASE + 0x0001
 The power events monitor is already closed.
 
const int WCL_E_PEM_FEATURE_NOT_SUPPORTED = WCL_E_PEM_BASE + 0x0002
 The power state monitoring feature is supported on Windows 8 and above.
 
const int WCL_E_CFGMGR_BASE = WCL_E_BASE + 0x7000
 The base error code for Configuration Manager error codes.
 
const int WCL_E_CFGMGR_LOAD_FAILED = WCL_E_CFGMGR_BASE + 0x0000
 Unable to load Configuration Manager API.
 
const unsigned char WCL_MSG_CATEGORY_SYSTEM = 1
 System messages category.
 
const unsigned char WCL_MSG_CATEGORY_WIFI = 2
 WiFi Framework messages category.
 
const unsigned char WCL_MSG_CATEGORY_BLUETOOTH = 3
 Bluetooth Framework messages category.
 
const unsigned char WCL_MSG_CATEGORY_IRDA = 4
 IrDA Framework messages category.
 
const unsigned char WCL_MSG_CATEGORY_SERIAL = 5
 Serial Framework messages category.
 
const unsigned char WCL_MSG_CATEGORY_USB = 6
 USB Framework messages category.
 
const unsigned char WCL_MSG_CATEGORY_WII = 7
 Wii remote Framework messages category.
 
const unsigned char WCL_MSG_CATEGORY_KINECT = 8
 Kinect Framework messages category.
 
const unsigned char WCL_MSG_CATEGORY_CONNECTION = 9
 The connections and connection providers messages category.
 
const unsigned char WCL_MSG_CATEGORY_AUDIO = 10
 The audio switcher messages category.
 
const unsigned char WCL_MSG_CATEGORY_USER = 200
 User defined message categories should start from this Category ID.
 
const unsigned char WCL_MSG_ID_SYS_HARDWARE_CHANGED = 1
 The Hardware Change message ID.
 
const unsigned char WCL_MSG_ID_SYS_POWER_STATE_CHANGED = 2
 The Power State Changed message ID.
 
const unsigned char WCL_MSG_ID_SYS_THREAD_SIGNAL = 3
 The WCL Thread Signal message ID.
 
const unsigned char WCL_MSG_ID_SYS_THREAD_SYNCHRONIZE = 4
 The WCL Thread Synchronize message ID.
 
CwclOsVersion wclOsVersion
 Global instance of the OS version reader class.