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.
//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.