blob: 709fa6bab93abb26ecf66d4850e148387fbbcb33 [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
bungeman@google.com9df621d2011-06-23 21:43:52 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * 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.com9df621d2011-06-23 21:43:52 +00007 */
8
epoger@google.comec3ed6a2011-07-28 14:26:00 +00009
bungeman@google.com9df621d2011-06-23 21:43:52 +000010#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 */
bungeman@google.com2e2f3f52011-09-16 15:37:20 +000021class SkAutoCoInitialize : SkNoncopyable {
bungeman@google.com9df621d2011-06-23 21:43:52 +000022private:
23 HRESULT fHR;
24public:
bungeman@google.com2e2f3f52011-09-16 15:37:20 +000025 SkAutoCoInitialize();
26 ~SkAutoCoInitialize();
27 bool succeeded();
bungeman@google.com9df621d2011-06-23 21:43:52 +000028};
29
30#endif