[
uuid(EA544A21-C82D-11D1-A3E4-00A0C90ABCDE),
version(1.0),
helpstring("VBA PropertyBag"),
helpfile("VB98.CHM"),
helpcontext(0x000df908)
]
library VBRUN
{
// TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}
importlib("stdole2.tlb");
// Forward declare all types defined in this typelib
interface _PropertyBag;
[
odl,
uuid(4495AD01-C993-11D1-A3E4-00A0C90AEA82),
helpstring("A PropertyBag object holds information that is to be persisted across invocations of a control."),
helpcontext(0x000df639),
hidden,
dual,
nonextensible,
oleautomation
]
interface _PropertyBag : IDispatch {
[id(0x00000001), helpstring("Returns a persisted value from a PropertyBag class object."), helpcontext(0x000df63a)]
HRESULT ReadProperty(
[in] BSTR Name,
[in, optional] VARIANT DefaultValue,
[out, retval] VARIANT* Value);
[id(0x00000002), helpstring("Writes a value to be persisted to a PropertyBag class object."), helpcontext(0x000df63b)]
HRESULT WriteProperty(
[in] BSTR Name,
[in] VARIANT Value,
[in, optional] VARIANT DefaultValue);
[id(0x00000003), propget, helpstring("A byte array representing the contents of the PropertyBag"), helpcontext(0x000df973)]
HRESULT Contents([out, retval] VARIANT* retval);
[id(0x00000003), propput, helpstring("A byte array representing the contents of the PropertyBag"), helpcontext(0x000df973)]
HRESULT Contents([in] VARIANT retval);
};
[
uuid(D5DE8D20-5BB8-11D1-A1E3-00A0C90F2731),
helpstring("A PropertyBag object holds information that is to be persisted across invocations of a control."),
helpcontext(0x000df639)
]
coclass PropertyBag {
[default] interface _PropertyBag;
};
};
#Compile Exe
#Dim All
' Class Identifiers
$CLSID_VBRUN_PropertyBag = Guid$("{D5DE8D20-5BB8-11D1-A1E3-00A0C90F2731}")
' Interface Identifiers
$IID_VBRUN_Int__PropertyBag = Guid$("{4495AD01-C993-11D1-A3E4-00A0C90AEA82}")
Interface Int__PropertyBag $IID_VBRUN_Int__PropertyBag
Inherit IDispatch
Method ReadProperty <1> (ByVal PB_Name As WString, Opt ByVal DefaultValue As Variant) As Variant
Method WriteProperty <2> (ByVal PB_Name As WString, ByVal Value As Variant, Opt ByVal DefaultValue As Variant)
Property Get Contents <3> () As Variant
Property Set Contents <3> (ByVal retval As Variant)
End Interface
Function PBMain () As Long
Local PropertyBag As Int__PropertyBag
PropertyBag = NewCom $IID_VBRUN_Int__PropertyBag
PropertyBag.WriteProperty "1", "2"
End Function
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 3