Показать сообщение отдельно
Старый 21.08.2004, 14:10     # 10
dyr_farot
Advanced Member
 
Регистрация: 23.08.2003
Сообщения: 442

dyr_farot Нимб уже пробиваетсяdyr_farot Нимб уже пробивается
DWORD dwResult;

// Call the WNetCancelConnection2 function, specifying
// that the connection should no longer be a persistent one.
//
dwResult = WNetCancelConnection2("z:",
CONNECT_UPDATE_PROFILE, // remove connection from profile
FALSE); // fail if open files or jobs

// Process errors.
// The device is not a local redirected device.
//
if (dwResult == ERROR_NOT_CONNECTED)
{
TextOut(hdc, 10, 10, "Drive z: not connected.", 23);
return FALSE;
}

// Call an application-defined error handler.
//
else if(dwResult != NO_ERROR)
{
NetErrorHandler(hwnd, dwResult, (LPSTR)"WNetCancelConnection2");
return FALSE;
}
//
// Otherwise, report canceling the connection.
//
TextOut(hdc, 10, 10, "Connection closed for z:.", 25);
dyr_farot вне форума