epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
bungeman@google.com | 9df621d | 2011-06-23 21:43:52 +0000 | [diff] [blame] | 2 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 3 | * Copyright 2011 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
bungeman@google.com | 9df621d | 2011-06-23 21:43:52 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 9 | |
bungeman@google.com | 9df621d | 2011-06-23 21:43:52 +0000 | [diff] [blame] | 10 | #ifndef SkAutoCo_DEFINED |
| 11 | #define SkAutoCo_DEFINED |
| 12 | |
| 13 | #define WIN32_LEAN_AND_MEAN |
| 14 | #include <Windows.h> |
| 15 | #include "SkTemplates.h" |
| 16 | |
| 17 | /** |
| 18 | * An instance of this class initializes COM on creation |
| 19 | * and closes the COM library on destruction. |
| 20 | */ |
| 21 | class AutoCoInitialize : SkNoncopyable { |
| 22 | private: |
| 23 | HRESULT fHR; |
| 24 | public: |
| 25 | AutoCoInitialize(); |
| 26 | ~AutoCoInitialize(); |
| 27 | HRESULT getHR(); |
| 28 | }; |
| 29 | |
| 30 | #endif |