source: trunk/Utilities/Miscellaneous/LowBitnessHost/Host/Foo.h @ 183

Last change on this file since 183 was 183, checked in by roman, 11 years ago
File size: 1.4 KB
Line 
1// Foo.h : Declaration of the CFoo
2
3#pragma once
4#include "resource.h"       // main symbols
5
6
7
8#include "Host_i.h"
9
10
11
12#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
13#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
14#endif
15
16using namespace ATL;
17
18
19// CFoo
20
21class ATL_NO_VTABLE CFoo :
22        public CComObjectRootEx<CComSingleThreadModel>,
23        public CComCoClass<CFoo, &CLSID_Foo>,
24        public IDispatchImpl<IFoo, &IID_IFoo, &LIBID_HostLib, /*wMajor =*/ 1, /*wMinor =*/ 0>
25{
26public:
27        CFoo()
28        {
29        }
30
31DECLARE_REGISTRY_RESOURCEID(IDR_FOO)
32
33
34BEGIN_COM_MAP(CFoo)
35        COM_INTERFACE_ENTRY(IFoo)
36        COM_INTERFACE_ENTRY(IDispatch)
37END_COM_MAP()
38
39
40
41        DECLARE_PROTECT_FINAL_CONSTRUCT()
42
43        HRESULT FinalConstruct()
44        {
45                return S_OK;
46        }
47
48        void FinalRelease()
49        {
50        }
51
52public:
53
54// IFoo
55        STDMETHOD(Bar)()
56        {
57                MessageBox(GetActiveWindow(), _T("Hello, 32-bit World!"), _T("Information"), MB_OK);
58                return S_OK;
59        }
60
61};
62
63OBJECT_ENTRY_AUTO(__uuidof(Foo), CFoo)
Note: See TracBrowser for help on using the repository browser.