PageRenderTime 42ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/Visual Studio 2008/CppCOMClient/CppCOMClient.cpp

#
C++ | 42 lines | 16 code | 8 blank | 18 comment | 0 complexity | 27781e53de3951d731b7fa6e406b0504 MD5 | raw file
  1. /****************************** Module Header ******************************\
  2. * Module Name: CppCOMClient.cpp
  3. * Project: CppCOMClient
  4. * Copyright (c) Microsoft Corporation.
  5. *
  6. * The C++ code sample demonstrates using the raw COM APIs and using the C++
  7. * #import directive to automate the COM server ATLDllCOMServer.
  8. *
  9. * This source is subject to the Microsoft Public License.
  10. * See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
  11. * All other rights reserved.
  12. *
  13. * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
  14. * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
  16. \***************************************************************************/
  17. #pragma region Includes
  18. #include <stdio.h>
  19. #include "RawAPI.h" // The examples of using the raw COM API to
  20. // consume a COM server
  21. #include "ImportDirective.h" // The examples of using the #import directive
  22. // and smart pointers to consume a COM server
  23. #pragma endregion
  24. int wmain(int argc, wchar_t *argv[])
  25. {
  26. HANDLE hThread;
  27. hThread = CreateThread(NULL, 0, RawConsumeSTAComponent, NULL, 0, NULL);
  28. WaitForSingleObject(hThread, INFINITE);
  29. CloseHandle(hThread);
  30. hThread = CreateThread(NULL, 0, ImportCSharpComponent, NULL, 0, NULL);
  31. WaitForSingleObject(hThread, INFINITE);
  32. CloseHandle(hThread);
  33. return 0;
  34. }