Пример #1
0
int	Application::ExitInstance( void )
{
	// Clean up DNS Services.
	
	DNSServicesFinalize();
	return( 0 );
}
Пример #2
0
BOOL Application::InitInstance()
{
	DNSStatus			err;
	BrowserDialog		dialog;
	BOOL				dnsInitialized;
	
	dnsInitialized = FALSE;
	
	err = DNSServicesInitialize( kDNSFlagAdvertise, 0 );
	if( err )
	{
		AfxMessageBox( IDP_SOCKETS_INIT_FAILED );
		goto exit;
	}
	dnsInitialized = TRUE;

	// Display the main browser dialog.
	
	m_pMainWnd = &dialog;
	dialog.DoModal();

	// Dialog has been closed. Return false to exit the app and not start the app's message pump.

exit:
	if( dnsInitialized )
	{
		DNSServicesFinalize();
	}
	return( FALSE );
}
Пример #3
0
int main( int argc, char* argv[] )
{
    DNSStatus		err;

    // Set up DNS Services and install a Console Control Handler to handle things like control-c signals.

    err = DNSServicesInitialize( kDNSFlagAdvertise, 0 );
    require_noerr_string( err, exit, "could not initialize DNSServiceTest" );

#if( __MACH__ )
    signal( SIGINT, SigIntHandler );
#endif

#if( defined( WINVER ) )
    SetConsoleCtrlHandler( ConsoleControlHandler, TRUE );
#endif

    ProcessArgs( argc, argv );

exit:
    DNSServicesFinalize();
    return( err );
}