OSDN Git Service

最初のコミット
[winaudioj/stedx.git] / sf_com.cpp
1 /*
2   ==============================================================================
3
4    This file is part of the S.F.Tracker
5    Copyright 2005-7 by Satoshi Fujiwara.
6
7    S.F.Tracker can be redistributed and/or modified under the terms of the
8    GNU General Public License, as published by the Free Software Foundation;
9    either version 2 of the License, or (at your option) any later version.
10
11    S.F.Tracker is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15
16    You should have received a copy of the GNU General Public License
17    along with S.F.Tracker; if not, visit www.gnu.org/licenses or write to the
18    Free Software Foundation, Inc., 59 Temple Place, Suite 330, 
19    Boston, MA 02111-1307 USA
20
21   ==============================================================================
22 */
23 /** @file
24  *  @brief util
25  *  @author S.F. (Satoshi Fujiwara)
26  */
27
28 #include "stdafx.h"
29 #include <objbase.h>
30 #include "sf_com.h"
31 namespace sf {
32
33     struct com_initialize::impl
34     {
35                 impl(void * reserved,unsigned int init) : hr(::CoInitializeEx(reserved,init))
36         {
37         }
38
39         ~impl()
40         {
41                         if(hr == S_OK){
42                     ::CoUninitialize();
43                         }
44         }
45         private:
46                 HRESULT hr;
47     };
48
49     com_initialize::com_initialize(void * reserved,unsigned int  init)
50         : m_impl(new com_initialize::impl(reserved,init))
51     {
52     };
53
54         //template <typename ComClass,typename ComInterface> boost::intrusive_ptr<ComInterface> com_creator<ComClass,ComInterface>::create_instance()
55         //{
56         //      ComClass * com_ptr;
57         //      CoCreateInstance( __uuidof(ComClass), NULL,
58         //                       CLSCTX_ALL, __uuidof(ComInterface),
59         //                       (void**)&com_ptr);
60         //      return instrusive_ptr<ComClass>(com_ptr,false);
61         //};
62
63
64 }