d194.bmp.txt
来自「Visual C++通信编程工程实例精解(附盘)」· 文本 代码 · 共 47 行
TXT
47 行
194
{
//Time to get the results of the WriteFile
break;
}
case WAIT_TIMEOUT :
{
TRACE(_TEXT("write time out\n"》;
nRet=-2;
goto Exit;
}
case WAIT_FAILED: //Wait failed. Shouldn't happen.
{
TRACE(_TEXT("Write WAIT_FAILED: \n "》;
nRet=-l;
goto Exit;
}
case WAIT_OBJECT_O+1:
{
//stop event set
TRACE(_TEXT("stop event set"》;
nRet=-3;
goto Exit;
}
default: //This case should never occur.
{
TRACE(_TEXT("Unexpected Wait retum value '%x"'),dwHandleSignaled);
nRet=-l;
goto Exit;
)
)
,,判断是否已经结束
if(!GetOverlappedResult(m_hFileHandle,
&m_overlappedWrite,
&dwHaveWritten,
TRUE》
{
dwLastError= GetLastError().
//Its possible for this error to occur if the
// service provider has closed the port.
if (dwLastError - ERROR_INVALID_HANDLE)
{
TRACE(_TEXr( "ERROR_INVALID_HANDLE,
Likely that the Service Provider has closed the port.\n"》;
nRet=-l;
、1、
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?