PageRenderTime 32ms CodeModel.GetById 29ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/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
26#pragma once
27
28
29//
30//   FUNCTION: AutomatePowerPointByImport(LPVOID)
31//
32//   PURPOSE: Automate Microsoft PowerPoint using the #import directive and 
33//      smart pointers.
34//
35//   PARAMETERS:
36//      * lpParam - The thread data passed to the function using the 
37//      lpParameter parameter when creating a thread. 
38//      (http://msdn.microsoft.com/en-us/library/ms686736.aspx)
39//
40//   RETURN VALUE: The return value indicates the success or failure of the 
41//      function. 
42//
43DWORD WINAPI AutomatePowerPointByImport(LPVOID lpParam);