]>
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.
17 Change History (most recent first):
20 Revision 1.1 2009/05/26 04:43:54 herscher
21 <rdar://problem/3948252> COM component that can be used with any .NET language and VB.
27 #include "resource.h" // main symbols
33 #if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
34 #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."
41 class ATL_NO_VTABLE CTXTRecord
:
42 public CComObjectRootEx
< CComSingleThreadModel
>,
43 public CComCoClass
< CTXTRecord
, & CLSID_TXTRecord
>,
44 public IDispatchImpl
< ITXTRecord
, & IID_ITXTRecord
, & LIBID_Bonjour
, /*wMajor =*/ 1 , /*wMinor =*/ 0 >
53 DECLARE_REGISTRY_RESOURCEID ( IDR_TXTRECORD
)
56 BEGIN_COM_MAP ( CTXTRecord
)
57 COM_INTERFACE_ENTRY ( ITXTRecord
)
58 COM_INTERFACE_ENTRY ( IDispatch
)
63 DECLARE_PROTECT_FINAL_CONSTRUCT ()
65 HRESULT
FinalConstruct ()
74 TXTRecordDeallocate ( & m_tref
);
80 STDMETHOD ( SetValue
)( BSTR key
, VARIANT value
);
81 STDMETHOD ( RemoveValue
)( BSTR key
);
82 STDMETHOD ( ContainsKey
)( BSTR key
, VARIANT_BOOL
* retval
);
83 STDMETHOD ( GetValueForKey
)( BSTR key
, VARIANT
* value
);
84 STDMETHOD ( GetCount
)( ULONG
* count
);
85 STDMETHOD ( GetKeyAtIndex
)( ULONG index
, BSTR
* retval
);
86 STDMETHOD ( GetValueAtIndex
)( ULONG index
, VARIANT
* retval
);
90 typedef std :: vector
< BYTE
> ByteArray
;
91 ByteArray m_byteArray
;
100 return TXTRecordGetLength ( & m_tref
);
106 return TXTRecordGetBytesPtr ( & m_tref
);
112 const unsigned char * bytes
,
117 OBJECT_ENTRY_AUTO ( __uuidof ( TXTRecord
), CTXTRecord
)