]>
git.saurik.com Git - apple/mdnsresponder.git/blob - mDNSWindows/DLLX/TXTRecord.h
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
34 #if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
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."
50 class ATL_NO_VTABLE CTXTRecord
:
52 public CComObjectRootEx
< CComSingleThreadModel
>,
54 public CComCoClass
< CTXTRecord
, & CLSID_TXTRecord
>,
56 public IDispatchImpl
< ITXTRecord
, & IID_ITXTRecord
, & LIBID_Bonjour
, /*wMajor =*/ 1 , /*wMinor =*/ 0 >
74 DECLARE_REGISTRY_RESOURCEID ( IDR_TXTRECORD
)
80 BEGIN_COM_MAP ( CTXTRecord
)
82 COM_INTERFACE_ENTRY ( ITXTRecord
)
84 COM_INTERFACE_ENTRY ( IDispatch
)
94 DECLARE_PROTECT_FINAL_CONSTRUCT ()
98 HRESULT
FinalConstruct ()
116 TXTRecordDeallocate ( & m_tref
);
128 STDMETHOD ( SetValue
)( BSTR key
, VARIANT value
);
130 STDMETHOD ( RemoveValue
)( BSTR key
);
132 STDMETHOD ( ContainsKey
)( BSTR key
, VARIANT_BOOL
* retval
);
134 STDMETHOD ( GetValueForKey
)( BSTR key
, VARIANT
* value
);
136 STDMETHOD ( GetCount
)( ULONG
* count
);
138 STDMETHOD ( GetKeyAtIndex
)( ULONG index
, BSTR
* retval
);
140 STDMETHOD ( GetValueAtIndex
)( ULONG index
, VARIANT
* retval
);
148 typedef std :: vector
< BYTE
> ByteArray
;
150 ByteArray m_byteArray
;
168 return TXTRecordGetLength ( & m_tref
);
180 return TXTRecordGetBytesPtr ( & m_tref
);
192 const unsigned char * bytes
,
202 OBJECT_ENTRY_AUTO ( __uuidof ( TXTRecord
), CTXTRecord
)