可以用Select进行保护
fd_set fds;
int nError;
struct timeval timeout;
timeout.tv_sec = iWaitTime; // second timeout
timeout.tv_usec = 0;
FD_ZERO(&fds);
FD_SET( m_hSocket, &fds ); //向集合fds添加hSocket
nError = select( m_hSocket + 1, &fds, NULL, NULL, &timeout );
if( nError <=0 )
{
sprintf(szError,"网络错误");
return -1;
}
fd_set fds;
int nError;
struct timeval timeout;
timeout.tv_sec = iWaitTime; // second timeout
timeout.tv_usec = 0;
FD_ZERO(&fds);
FD_SET( m_hSocket, &fds ); //向集合fds添加hSocket
nError = select( m_hSocket + 1, &fds, NULL, NULL, &timeout );
if( nError <=0 )
{
sprintf(szError,"网络错误");
return -1;
}
分数为150分
十万火级,如能给出答案,再送300分
有兴趣的人留下email
我把程序发给你们。
一个很cool的表格程序,请问如何改为activeX控件,有兴趣的我把源代码发给你们,感兴趣的人留下email,
是vc写的非常cool
[email protected] [email protected]
[email protected]