Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error in RASDIALPARAMS and Connect

Status
Not open for further replies.

eboxbd

Programmer
Dec 22, 2002
10
0
0
HK
Using the following code, the computer can connect with remote computer, but it does not show connection icon on system tray.

//Code starting...................
BOOL CMesDlg::Connect( const char *lpszUser1,
const char *lpszPass1, const char *lpszDialup1 )
{
RASDIALPARAMS rdParams;
DWORD dwRet;

Disconnect();

memset( &rdParams, 0, sizeof( RASDIALPARAMS ) );
rdParams.dwSize = sizeof( RASDIALPARAMS );
lstrcpy( rdParams.szPhoneNumber, lpszDialup1 );
rdParams.szCallbackNumber[0] = '*';
rdParams.szCallbackNumber[0] = '\0';
strcpy( rdParams.szUserName, lpszUser1 );
strcpy( rdParams.szPassword, lpszPass1 );

rdParams.szDomain[0] = '\0';

dwRet = RasDial( NULL, NULL, &rdParams, 0L,
(RASDIALFUNC) RasDialFunc, &m_hRasConn );

if( dwRet ){
if( RasGetErrorString( (UINT) dwRet,
(LPSTR) m_szLastError,sizeof( m_szLastError ) ) != 0 )
wsprintf( (LPSTR) m_szLastError,
"Undefined RAS Dial Error (%ld).", dwRet );
return( FALSE );
}

return( TRUE );
}

//Pls, help.

Sincerely,
Haider.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top