btw, how to get the error string :

LPVOID lpMsgBuf;
DWORD res = FormatMessage(
        FORMAT_MESSAGE_ALLOCATE_BUFFER | 
        FORMAT_MESSAGE_FROM_SYSTEM |
        FORMAT_MESSAGE_IGNORE_INSERTS,
    nullptr,
    daveGetOpenSocketErr(),
    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
    (LPTSTR) &lpMsgBuf,
    0,
    nullptr);
if ( res > 0 )
{
    // use string ...
    LocalFree(lpMsgBuf);
}
 

Last edit: Marco Lazzarotto 2014-05-13