Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / TAO / utils / NamingViewer / NamingViewer.cpp
blob9521287266b72913fecde18aadb1bb41836178b8
1 #include "stdafx.h"
2 #include "NamingViewer.h"
3 #include "NamingViewerDlg.h"
4 #include "ace/ARGV.h"
5 #include "ace/ACE.h"
6 #include "ace/Argv_Type_Converter.h"
7 #include "ace/Init_ACE.h"
9 #ifdef _DEBUG
10 #define new DEBUG_NEW
11 #undef THIS_FILE
12 static char THIS_FILE[] = __FILE__;
13 #endif
15 /////////////////////////////////////////////////////////////////////////////
16 // CNamingViewerApp
18 BEGIN_MESSAGE_MAP(CNamingViewerApp, CWinApp)
19 //{{AFX_MSG_MAP(CNamingViewerApp)
20 // NOTE - the ClassWizard will add and remove mapping macros here.
21 // DO NOT EDIT what you see in these blocks of generated code!
22 //}}AFX_MSG
23 ON_COMMAND(ID_HELP, CWinApp::OnHelp)
24 END_MESSAGE_MAP()
26 /////////////////////////////////////////////////////////////////////////////
27 // CNamingViewerApp construction
29 CNamingViewerApp::CNamingViewerApp()
31 // TODO: add construction code here,
32 // Place all significant initialization in InitInstance
35 /////////////////////////////////////////////////////////////////////////////
36 // The one and only CNamingViewerApp object
38 CNamingViewerApp theApp;
40 /////////////////////////////////////////////////////////////////////////////
41 // CNamingViewerApp initialization
43 BOOL CNamingViewerApp::InitInstance()
45 // Standard initialization
46 // If you are not using these features and wish to reduce the size
47 // of your final executable, you should remove from the following
48 // the specific initialization routines you do not need.
50 From MFC 5.0, Enable3dControls and Enable3dControlsStatic are obsolete
51 because their functionality is incorporated into Microsoft's 32-bit
52 operating systems. Basically no need to call with VC5.0 and above.
54 #if !defined (_WIN32_WCE)
55 #ifdef _AFXDLL
56 Enable3dControls(); // Call this when using MFC in a shared DLL
57 #else
58 Enable3dControlsStatic(); // Call this when linking to MFC statically
59 #endif
60 #endif
62 // Parse command line arguments so we can initialize ORB with them
63 ACE_ARGV Argv (m_lpCmdLine);
65 ACE::init();
67 int argc = Argv.argc ();
68 CORBA::ORB_var ORB = CORBA::ORB_init(argc, Argv.argv());
70 CNamingViewerDlg dlg(ORB);
71 m_pMainWnd = &dlg;
72 int const nResponse = dlg.DoModal();
73 if (nResponse == IDOK)
75 // TODO: Place code here to handle when the dialog is
76 // dismissed with OK
78 else if (nResponse == IDCANCEL)
80 // TODO: Place code here to handle when the dialog is
81 // dismissed with Cancel
84 ACE::fini();
85 // Since the dialog has been closed, return FALSE so that we exit the
86 // application, rather than start the application's message pump.
87 return FALSE;