#include <serialport.h>
◆ CSerialException()
CSerialException::CSerialException |
( |
DWORD |
dwError | ) |
|
131{
133}
DWORD m_dwError
Definition: serialport.h:46
◆ ~CSerialException()
CSerialException::~CSerialException |
( |
| ) |
|
◆ GetErrorMessage() [1/2]
CString CSerialException::GetErrorMessage |
( |
| ) |
|
122{
123 CString rVal;
124 LPTSTR pstrError = rVal.GetBuffer(4096);
126 rVal.ReleaseBuffer();
127 return rVal;
128}
CString GetErrorMessage()
Definition: serialport.cpp:121
#define NULL
Definition: nidaqmx.h:84
◆ GetErrorMessage() [2/2]
BOOL CSerialException::GetErrorMessage |
( |
LPTSTR |
lpstrError, |
|
|
UINT |
nMaxError, |
|
|
PUINT |
pnHelpContext = NULL |
|
) |
| |
|
virtual |
97{
98 ASSERT(pstrError !=
NULL && AfxIsValidString(pstrError, nMaxError));
99
100 if (pnHelpContext !=
NULL)
101 *pnHelpContext = 0;
102
103 LPTSTR lpBuffer;
104 BOOL bRet = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
105 NULL,
m_dwError, MAKELANGID(LANG_NEUTRAL, SUBLANG_SYS_DEFAULT),
106 (LPTSTR) &lpBuffer, 0,
NULL);
107
109 *pstrError = '\0';
110 else
111 {
112 lstrcpyn(pstrError, lpBuffer, nMaxError);
114
115 LocalFree(lpBuffer);
116 }
117
118 return bRet;
119}
#define TRUE
Definition: nidaqmx.h:78
#define FALSE
Definition: nidaqmx.h:81
◆ m_dwError
DWORD CSerialException::m_dwError |
The documentation for this class was generated from the following files: