home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 September / Chip_2002-09_cd1.bin / zkuste / vbasic / Data / Utils / XZipComp.exe / XceedWinsock.Cab / F112744_Main.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-10  |  1.3 KB  |  58 lines

  1. /*
  2.  * Xceed Winsock Library Sample: Chat connectionless
  3.  * Copyright (c) 2000 Xceed Software Inc.
  4.  *
  5.  * This is a standard chat console application using connectionless 
  6.  * sockets to broadcast over the network to find available chat clients.
  7.  *
  8.  * This particular file is the entry point of the application.
  9.  *
  10.  * This file is part of the Xceed Winsock Library Samples.
  11.  * The source code in this file is only intended as a supplement
  12.  * to Xceed Winsock Library's documentation, and is provided "as is", 
  13.  * without warranty of any kind, either expressed or implied.
  14.  *
  15.  */
  16.  
  17.  
  18. #include "stdafx.h"
  19. #include <stdio.h>
  20. #include <conio.h>
  21. #include "Chat.h"
  22.  
  23. /*
  24.  * main:
  25.  *
  26.  *   This is the entry point of the application. We create our application
  27.  *   object and make it run.
  28.  */
  29.  
  30. int main( int argc, char* argv[] )
  31. {
  32.   CoInitializeEx( NULL, COINIT_MULTITHREADED );
  33.  
  34.   CComObject< CChat >*  pxApp;
  35.   HRESULT hr = CComObject< CChat >::CreateInstance( &pxApp );
  36.  
  37.   if( FAILED( hr ) )
  38.   {
  39.     printf( "Error: CreateInstance returned %08X\n", hr );
  40.   }
  41.   else
  42.   {
  43.     pxApp->AddRef();
  44.     pxApp->Run();
  45.     pxApp->Release();
  46.   }
  47.  
  48.   printf( "\n\nPress any key to quit\n" );
  49.   getch();
  50.  
  51.   CoUninitialize();
  52.   return 0;
  53. }
  54.  
  55. //
  56. // END_OF_FILE
  57. //
  58.