Q> Как соединиться по RAS ?
A>

#include <ras.h>
#include <raserror.h>

bool DialUp(LPTSTR PhoneNumber,LPTSTR UserName,LPTSTR Password)
{
RASDIALPARAMS rdParams;
rdParams.dwSize = sizeof(RASDIALPARAMS);
rdParams.szEntryName[0] = '\0';
lstrcpy( rdParams.szPhoneNumber, PhoneNumber );
rdParams.szCallbackNumber[0] = '\0';
lstrcpy( rdParams.szUserName, UserName );
lstrcpy( rdParams.szPassword, Password );
rdParams.szDomain[0] = '\0';

HRASCONN hRasConn = NULL;
DWORD dwRet = RasDial( NULL, NULL, &rdParams, 0L, NULL, &hRasConn );
if ( dwRet == 0 ) return true;
char szBuf[256];
if ( RasGetErrorString( (UINT)dwRet, (LPSTR)szBuf, 256 ) != 0 )
wsprintf( (LPSTR)szBuf, "Undefined RAS Dial Error (%ld).", dwRet );
RasHangUp( hRasConn );
MessageBox( (LPSTR)szBuf, "Error", MB_OK | MB_ICONSTOP );
return false;
}


Рейтинг@Mail.ru be number one Submitter.ru - Promoting!
Хостинг от uCoz