summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2002-01-23 15:04:05 +0000
committerSteve Huston <shuston@riverace.com>2002-01-23 15:04:05 +0000
commit764678f0a6540df515de62575d7166438131903a (patch)
tree5bfd0ce4d52a35a607c0f0f679b469b7db6418ea /examples
parentd73718494356453ec33e7243203ebbfaac980d15 (diff)
downloadATCD-764678f0a6540df515de62575d7166438131903a.tar.gz
ChangeLogTag:Tue Jan 22 17:42:39 2002 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/NT_Service/main.cpp14
-rw-r--r--examples/NT_Service/ntsvc.cpp1
2 files changed, 13 insertions, 2 deletions
diff --git a/examples/NT_Service/main.cpp b/examples/NT_Service/main.cpp
index 5f23fa3fb7d..5f8454e2c28 100644
--- a/examples/NT_Service/main.cpp
+++ b/examples/NT_Service/main.cpp
@@ -188,13 +188,23 @@ Process::run (int argc, ACE_TCHAR* argv[])
}
else
{
+ ofstream *output_file = new ofstream("ntsvc.log", ios::out);
+ if (output_file && output_file->rdstate() == ios::goodbit)
+ ACE_LOG_MSG->msg_ostream(output_file, 1);
+ ACE_LOG_MSG->open(argv[0],
+ ACE_Log_Msg::STDERR | ACE_Log_Msg::OSTREAM,
+ 0);
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%T (%t): Starting service.\n")));
+
ACE_NT_SERVICE_RUN (Beeper,
SERVICE::instance (),
ret);
if (ret == 0)
ACE_ERROR ((LM_ERROR,
- "%p\n",
- "Couldn't start service"));
+ ACE_TEXT ("%p\n"),
+ ACE_TEXT ("Couldn't start service")));
+ else
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%T (%t): Service stopped.\n")));
}
return 0;
diff --git a/examples/NT_Service/ntsvc.cpp b/examples/NT_Service/ntsvc.cpp
index c671f4a7967..d872769bc46 100644
--- a/examples/NT_Service/ntsvc.cpp
+++ b/examples/NT_Service/ntsvc.cpp
@@ -72,6 +72,7 @@ Service::handle_timeout (const ACE_Time_Value &tv,
{
ACE_UNUSED_ARG (tv);
MessageBeep (MB_OK);
+ ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("%T (%t): Beep...\n")));
return 0;
}