summaryrefslogtreecommitdiff
path: root/TAO/examples/Borland/ChatClient.cpp
blob: 95d9f4e8e8eb32ade3c924e314eae214ce0e3f3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// $Id$
//---------------------------------------------------------------------------
#include "pch.h"
#pragma hdrstop
#include <ace/ace.h>
#include <tao/corba.h>
#include "ChatClientWnd.h"
USERES("ChatClient.res");
USEFORM("ChatClientWnd.cpp", ChatClientWindow);
USEUNIT("BroadcasterC.cpp");
USEUNIT("BroadcasterS.cpp");
USEUNIT("ReceiverC.cpp");
USEUNIT("ReceiverS.cpp");
USEUNIT("ReceiverImpl.cpp");
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
  ACE::init ();

  try
    {
      Application->Initialize ();
      Application->Title = "CORBA Chat Client";
      Application->CreateForm (__classid (TChatClientWindow), &ChatClientWindow);
      Application->Run ();
    }
  catch (Exception &exception)
    {
      Application->ShowException (&exception);
    }
  catch (CORBA::Exception &exception)
    {
      ShowMessage (String ("CORBA exception: ") + exception._id ());
    }
  catch (...)
    {
      ShowMessage ("Unknown exception");
    }

  // Must explicitly free the window to ensure the orb is shut down
  // before ACE::fini is called.
  delete ChatClientWindow;

  ACE::fini ();

  return 0;
}
//---------------------------------------------------------------------------