1 /* -*- Mode: C; tab-width: 4 -*- 2 * 3 * Copyright (c) 2009 Apple Computer, Inc. All rights reserved. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 19 20 #pragma once 21 22 #include "resource.h" // main symbols 23 24 25 26 #include "DLLX.h" 27 28 #include "_IDNSSDEvents_CP.H" 29 30 31 32 33 34 #if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA) 35 36 #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." 37 38 #endif 39 40 41 42 43 44 45 46 // CDNSSDEventManager 47 48 49 50 class ATL_NO_VTABLE CDNSSDEventManager : 51 52 public CComObjectRootEx<CComSingleThreadModel>, 53 54 public CComCoClass<CDNSSDEventManager, &CLSID_DNSSDEventManager>, 55 56 public IConnectionPointContainerImpl<CDNSSDEventManager>, 57 58 public CProxy_IDNSSDEvents<CDNSSDEventManager>, 59 60 public IDispatchImpl<IDNSSDEventManager, &IID_IDNSSDEventManager, &LIBID_Bonjour, /*wMajor =*/ 1, /*wMinor =*/ 0> 61 62 { 63 64 public: 65 66 CDNSSDEventManager() 67 68 { 69 70 } 71 72 73 74 DECLARE_REGISTRY_RESOURCEID(IDR_DNSSDEVENTMANAGER) 75 76 77 78 79 80 BEGIN_COM_MAP(CDNSSDEventManager) 81 82 COM_INTERFACE_ENTRY(IDNSSDEventManager) 83 84 COM_INTERFACE_ENTRY(IDispatch) 85 86 COM_INTERFACE_ENTRY(IConnectionPointContainer) 87 88 END_COM_MAP() 89 90 91 92 BEGIN_CONNECTION_POINT_MAP(CDNSSDEventManager) 93 94 CONNECTION_POINT_ENTRY(__uuidof(_IDNSSDEvents)) 95 96 END_CONNECTION_POINT_MAP() 97 98 99 100 101 102 DECLARE_PROTECT_FINAL_CONSTRUCT() 103 104 105 106 HRESULT FinalConstruct() 107 108 { 109 110 return S_OK; 111 112 } 113 114 115 116 void FinalRelease() 117 118 { 119 120 } 121 122 123 124 public: 125 126 127 128 }; 129 130 131 132 OBJECT_ENTRY_AUTO(__uuidof(DNSSDEventManager), CDNSSDEventManager) 133 134