home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / vcoledb / consumer / multiread / multiread.cpp < prev    next >
C/C++ Source or Header  |  1998-03-26  |  1KB  |  45 lines

  1. // MultiRead.cpp : Implementation of WinMain
  2.  
  3.  
  4. // Note: Proxy/Stub Information
  5. //      To build a separate proxy/stub DLL,
  6. //      run nmake -f MultiReadps.mk in the project directory.
  7.  
  8. #include "stdafx.h"
  9. #include "resource.h"
  10. #include "initguid.h"
  11. #include "MultiRead.h"
  12.  
  13. #include "MultiRead_i.c"
  14. #include "MultiDlg.h"
  15.  
  16. CExeModule _Module;
  17.  
  18. BEGIN_OBJECT_MAP(ObjectMap)
  19. END_OBJECT_MAP()
  20.  
  21. /////////////////////////////////////////////////////////////////////////////
  22. //
  23. extern "C" int WINAPI _tWinMain(HINSTANCE hInstance,
  24.     HINSTANCE /*hPrevInstance*/, LPTSTR lpCmdLine, int /*nShowCmd*/)
  25. {
  26.     lpCmdLine = GetCommandLine(); //this line necessary for _ATL_MIN_CRT
  27.  
  28. #if _WIN32_WINNT >= 0x0400 & defined(_ATL_FREE_THREADED)
  29.     HRESULT hRes = CoInitializeEx(NULL, COINIT_MULTITHREADED);
  30. #else
  31.     HRESULT hRes = CoInitialize(NULL);
  32. #endif
  33.     _ASSERTE(SUCCEEDED(hRes));
  34.     _Module.Init(ObjectMap, hInstance, &LIBID_MULTIREADLib);
  35.     _Module.dwThreadID = GetCurrentThreadId();
  36.     TCHAR szTokens[] = _T("-/");
  37.  
  38.     CMultiDlg dlg;
  39.     dlg.DoModal();
  40.  
  41.     _Module.Term();
  42.     CoUninitialize();
  43.     return 0;
  44. }
  45.