// FilesAndActions.h : Declaration of the CFilesAndActions #pragma once #include "resource.h" // main symbols #include // IFilesAndActions [ object, uuid("14AD0A5D-16AD-4C3F-A56D-A2F4FE7458F9"), dual, helpstring("IFilesAndActions Interface"), pointer_default(unique) ] __interface IFilesAndActions : IDispatch { [propget, id(DISPID_VALUE), helpstring("property Item")] HRESULT Item([in] long Index, [out, retval] VARIANT* pVal); [propget, id(DISPID_NEWENUM), helpstring("property _NewEnum"), restricted] HRESULT _NewEnum([out, retval] LPUNKNOWN* pVal); [propget, id(1), helpstring("property Count")] HRESULT Count([out, retval] long* pVal); [id(2), helpstring("method Add. The new item is added to the end of the collection.")] HRESULT Add([in] VARIANT NewItem); [id(3), helpstring("method Remove. Specify the index of the item to remove.")] HRESULT Remove([in] long Index); }; // CFilesAndActions // typdefs to make life easier. typedef std::list StdVariantList; typedef CComEnumOnSTL, StdVariantList> STLVariantEnum; typedef ICollectionOnSTLImpl, STLVariantEnum> VariantCollImpl; [ coclass, threading("apartment"), vi_progid("WebChange.FilesAndActions"), progid("WebChange.FilesAndActions"), version(1.3), uuid("9819D968-C9A8-4528-BB0D-4AF0A8EDDBD8"), helpstring("FilesAndActions Class") ] class ATL_NO_VTABLE CFilesAndActions : public IDispatchImpl, public IObjectSafetyImpl { public: CFilesAndActions() { } DECLARE_PROTECT_FINAL_CONSTRUCT() HRESULT FinalConstruct() { return S_OK; } void FinalRelease() { } public: STDMETHOD(Add)(VARIANT Item); STDMETHOD(Remove)(long Index); };