예제 #1
0
		std::string MainScreenHelper::ConnectServer(std::string hostname, int protocolVersion) {
			if (mainScreen == NULL) {
				return "mainScreen == NULL";
			}
			return mainScreen->Connect(ServerAddress(
			  hostname, protocolVersion == 3 ? ProtocolVersion::v075 : ProtocolVersion::v076));
		}
//------------
// MsgConnect \
//---------------------------------------------------------------------------
// Event:	PM_CONNECT
// Cause:	Issued by the connection thread when a connection has been
//			established
//
void *C_WINDOW_MAIN::MsgConnect( void *mp1, void *mp2 )
{
	// Tell the user he is connected
	pxcStatus->Text( "Connected to %s...", ServerAddress() );

	// Enable menu options so the user can select information
	pxcMenu->EnableItem( DM_WINDOWS );

	// Enable the toolbar buttons
	pxcTBar->ButtonEnable( DB_WND_GRP, TRUE );
	pxcTBar->ButtonEnable( DB_WND_SUB, TRUE );

	// Give the user some audible feedback to say that we've connected
	DosBeep( 100, 100 );

	// since we are now connected, open the subscription window and tell
	// it to update.
	SendMsg( WM_COMMAND, (void *)DM_SUBSCRIPTIONS, 0 );

	return FALSE;
}