1 /* -*- Mode: C; tab-width: 4 -*-
3 * Copyright (c) 2009 Apple Computer, Inc. All rights reserved.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include "resource.h" // main symbols
28 #include "DNSSDService.h"
36 #if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
38 #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."
52 class ATL_NO_VTABLE CDNSSDRecord
:
54 public CComObjectRootEx
<CComSingleThreadModel
>,
56 public CComCoClass
<CDNSSDRecord
, &CLSID_DNSSDRecord
>,
58 public IDispatchImpl
<IDNSSDRecord
, &IID_IDNSSDRecord
, &LIBID_Bonjour
, /*wMajor =*/ 1, /*wMinor =*/ 0>
72 DECLARE_REGISTRY_RESOURCEID(IDR_DNSSDRECORD
)
78 BEGIN_COM_MAP(CDNSSDRecord
)
80 COM_INTERFACE_ENTRY(IDNSSDRecord
)
82 COM_INTERFACE_ENTRY(IDispatch
)
92 DECLARE_PROTECT_FINAL_CONSTRUCT()
96 HRESULT
FinalConstruct()
114 inline CDNSSDService
*
120 return m_serviceObject
;
128 SetServiceObject( CDNSSDService
* serviceObject
)
132 m_serviceObject
= serviceObject
;
152 SetRecordRef( DNSRecordRef rref
)
166 STDMETHOD(Update
)(DNSSDFlags flags
, VARIANT rdata
, ULONG ttl
);
168 STDMETHOD(Remove
)(DNSSDFlags flags
);
176 CDNSSDService
* m_serviceObject
;
184 OBJECT_ENTRY_AUTO(__uuidof(DNSSDRecord
), CDNSSDRecord
)