PageRenderTime 55ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 1ms

/Visual Studio 2008/CppAutomatePowerPoint/Solution1.h

#
C Header | 43 lines | 2 code | 3 blank | 38 comment | 0 complexity | e9f8bee6d2a97694458dc0aa84a34393 MD5 | raw file
  1. /****************************** Module Header ******************************\
  2. * Module Name: Solution1.h
  3. * Project: CppAutomatePowerPoint
  4. * Copyright (c) Microsoft Corporation.
  5. *
  6. * The code in Solution1.h/cpp demonstrates the use of #import to automate
  7. * PowerPoint. #import (http://msdn.microsoft.com/en-us/library/8etzzkb6.aspx),
  8. * a new directive that became available with Visual C++ 5.0, creates VC++
  9. * "smart pointers" from a specified type library. It is very powerful, but
  10. * often not recommended because of reference-counting problems that typically
  11. * occur when used with the Microsoft Office applications. Unlike the direct
  12. * API approach in Solution2.h/cpp, smart pointers enable us to benefit from
  13. * the type info to early/late bind the object. #import takes care of adding
  14. * the messy guids to the project and the COM APIs are encapsulated in custom
  15. * classes that the #import directive generates.
  16. *
  17. * This source is subject to the Microsoft Public License.
  18. * See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
  19. * All other rights reserved.
  20. *
  21. * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
  22. * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
  23. * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
  24. \***************************************************************************/
  25. #pragma once
  26. //
  27. // FUNCTION: AutomatePowerPointByImport(LPVOID)
  28. //
  29. // PURPOSE: Automate Microsoft PowerPoint using the #import directive and
  30. // smart pointers.
  31. //
  32. // PARAMETERS:
  33. // * lpParam - The thread data passed to the function using the
  34. // lpParameter parameter when creating a thread.
  35. // (http://msdn.microsoft.com/en-us/library/ms686736.aspx)
  36. //
  37. // RETURN VALUE: The return value indicates the success or failure of the
  38. // function.
  39. //
  40. DWORD WINAPI AutomatePowerPointByImport(LPVOID lpParam);