本文整理汇总了C++中Error::HandleError方法的典型用法代码示例。如果您正苦于以下问题:C++ Error::HandleError方法的具体用法?C++ Error::HandleError怎么用?C++ Error::HandleError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Error
的用法示例。
在下文中一共展示了Error::HandleError方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
bool WinSockDll::Init(){
#if PLATFORM == PLATFORM_WINDOWS
int res = WSAStartup(MAKEWORD(2, 1), &_wsaData);
if(res==0)return true;
Error error;
switch(res){
case WSASYSNOTREADY:
error.HandleError(Log, "The underlying network subsystem is not ready for network communication.");
break;
case WSAVERNOTSUPPORTED:
error.HandleError(Log, "The version of Windows Sockets support requested is not provided by this particular Windows Sockets implementation.");
break;
case WSAEINPROGRESS:
error.HandleError(Log, "A blocking Windows Sockets 1.1 operation is in progress");
break;
case WSAEPROCLIM:
error.HandleError(Log, "A limit on the number of tasks supported by the Windows Sockets implementation has been reached.");
break;
case WSAEFAULT:
error.HandleError(Log, "The lpWSAData parameter is not a valid pointer.");
break;
}
return false;
#else
return true;
#endif
};
示例2: Cleanup
bool WinSockDll::Cleanup(){
#if PLATFORM == PLATFORM_WINDOWS
int res = WSACleanup();
if(res==0)return true;
Error error;
switch(res){
case WSANOTINITIALISED:
error.HandleError(Log, "A successful WSAStartup call must occur before using this function.");
break;
case WSAENETDOWN:
error.HandleError(Log, "The network subsystem has failed.");
break;
case WSAEINPROGRESS:
error.HandleError(Log, "A blocking Winsock call is in progress, or the service provider is still processing a callback function.");
break;
}
return false;
#endif
};