     1	BOOL FluidsApp::InitInstance()
     2	{
     3		AfxEnableControlContainer();
     4	
     5		// Standard initialization
     6		// If you are not using these features and wish to reduce the size
     7		//  of your final executable, you should remove from the following
     8		//  the specific initialization routines you do not need.
     9	
    10	#ifdef _AFXDLL
    11		Enable3dControls();			// Call this when using MFC in a shared DLL
    12	#else
    13		Enable3dControlsStatic();	// Call this when linking to MFC statically
    14	#endif
    15		Tango::Util *tg;
    16		try
    17		{
    18		
    19			tg = Tango::Util::init(m_hInstance,m_nCmdShow);
    20	
    21	                tg->server_init(true);
    22	
    23			tg->server_run();
    24	
    25		}
    26		catch (bad_alloc)
    27		{
    28			MessageBox((HWND)NULL,"Memory error","Command line",MB_ICONSTOP);
    29	                return(FALSE);
    30		}
    31		catch (Tango::DevFailed &e)
    32		{
    33			MessageBox((HWND)NULL,,e.errors[0].desc.in(),"Command line",MB_ICONSTOP);
    34			return(FALSE);
    35		}
    36		catch (CORBA::Exception &)
    37		{
    38			MessageBox((HWND)NULL,"Exception CORBA","Command line",MB_ICONSTOP);
    39	                return(FALSE);
    40		}
    41	
    42		m_pMainWnd = new CWnd;
    43		m_pMainWnd->Attach(tg->get_ds_main_window());
    44	
    45	        return TRUE;
    46	}
