summaryrefslogtreecommitdiff
path: root/tests/ACE_Init_Test.cpp
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>1999-04-30 16:25:32 +0000
committerSteve Huston <shuston@riverace.com>1999-04-30 16:25:32 +0000
commit9f07603c9fa1f3f364fc3483ab64ca151ef300e6 (patch)
tree4e38aa6839b3ede9be1474c976d04fe3c2c6c54c /tests/ACE_Init_Test.cpp
parent1887fd9f59eef349e3778e4e155504cf8a822669 (diff)
downloadATCD-9f07603c9fa1f3f364fc3483ab64ca151ef300e6.tar.gz
Compile-time change to call ACE::init, ACE::fini when ACE doesn't
do it automatically.
Diffstat (limited to 'tests/ACE_Init_Test.cpp')
-rw-r--r--tests/ACE_Init_Test.cpp73
1 files changed, 39 insertions, 34 deletions
diff --git a/tests/ACE_Init_Test.cpp b/tests/ACE_Init_Test.cpp
index c430726f91f..62dad4d1075 100644
--- a/tests/ACE_Init_Test.cpp
+++ b/tests/ACE_Init_Test.cpp
@@ -16,10 +16,10 @@
// ACE_Init_Test.cpp : Defines the class behaviors for the application.
//
+#include "ace/Thread_Manager.h"
#include "ACE_Init_Test_StdAfx.h"
#include "ACE_Init_Test.h"
#include "ACE_Init_TestDlg.h"
-#include "ace/Thread_Manager.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -34,11 +34,11 @@ static void * wait_and_kill_dialog (void *pBox);
// CACE_Init_TestApp
BEGIN_MESSAGE_MAP(CACE_Init_TestApp, CWinApp)
- //{{AFX_MSG_MAP(CACE_Init_TestApp)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG
- ON_COMMAND(ID_HELP, CWinApp::OnHelp)
+ //{{AFX_MSG_MAP(CACE_Init_TestApp)
+ // NOTE - the ClassWizard will add and remove mapping macros here.
+ // DO NOT EDIT what you see in these blocks of generated code!
+ //}}AFX_MSG
+ ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
@@ -46,8 +46,8 @@ END_MESSAGE_MAP()
CACE_Init_TestApp::CACE_Init_TestApp()
{
- // TODO: add construction code here,
- // Place all significant initialization in InitInstance
+ // TODO: add construction code here,
+ // Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
@@ -60,32 +60,37 @@ CACE_Init_TestApp theApp;
BOOL CACE_Init_TestApp::InitInstance()
{
- // Standard initialization
- // If you are not using these features and wish to reduce the size
- // of your final executable, you should remove from the following
- // the specific initialization routines you do not need.
-
- CACE_Init_TestDlg dlg;
- m_pMainWnd = &dlg;
- ACE_Thread_Manager::instance()->spawn (wait_and_kill_dialog,
- m_pMainWnd);
- int nResponse = dlg.DoModal();
- if (nResponse == IDOK)
- {
- // TODO: Place code here to handle when the dialog is
- // dismissed with OK
- }
- else if (nResponse == IDCANCEL)
- {
- // TODO: Place code here to handle when the dialog is
- // dismissed with Cancel
- }
-
- ACE_Thread_Manager::instance()->wait();
-
- // Since the dialog has been closed, return FALSE so that we exit the
- // application, rather than start the application's message pump.
- return FALSE;
+
+#if (defined (ACE_HAS_DLL) && (ACE_HAS_DLL == 0)) && \
+ defined (ACE_HAS_NONSTATIC_OBJECT_MANAGER)
+ ACE::init();
+#endif
+
+ CACE_Init_TestDlg dlg;
+ m_pMainWnd = &dlg;
+ ACE_Thread_Manager::instance()->spawn (wait_and_kill_dialog,
+ m_pMainWnd);
+ int nResponse = dlg.DoModal();
+ if (nResponse == IDOK)
+ {
+ // TODO: Place code here to handle when the dialog is
+ // dismissed with OK
+ }
+ else if (nResponse == IDCANCEL)
+ {
+ // TODO: Place code here to handle when the dialog is
+ // dismissed with Cancel
+ }
+
+ ACE_Thread_Manager::instance()->wait();
+
+ // Since the dialog has been closed, return FALSE so that we exit the
+ // application, rather than start the application's message pump.
+#if (defined (ACE_HAS_DLL) && (ACE_HAS_DLL == 0)) && \
+ defined (ACE_HAS_NONSTATIC_OBJECT_MANAGER)
+ ACE::fini();
+#endif
+ return FALSE;
}