// DogKey.h : Declaration of the CDogKey #ifndef __DOGKEY_H_ #define __DOGKEY_H_ #include "resource.h" // main symbols // //add the header files:Atlctl.h here // #include <Atlctl.h> / // CDogKey class ATL_NO_VTABLE CDogKey : public CComObjectRootEx<CComMultiThreadModel>, public CComCoClass<CDogKey, &CLSID_DogKey>, public ISupportErrorInfo, public IDispatchImpl<IDogKey, &IID_IDogKey, &LIBID_GRANDDOGMANAGELib>, /// //add this interface :IObjectSafetyImpl here /// public IObjectSafetyImpl<CDogKey,INTERFACESAFE_FOR_UNTRUSTED_CALLER> { public: CDogKey() { } DECLARE_REGISTRY_RESOURCEID(IDR_DOGKEY) DECLARE_PROTECT_FINAL_CONSTRUCT() BEGIN_COM_MAP(CDogKey) COM_INTERFACE_ENTRY(IDogKey) COM_INTERFACE_ENTRY(IDispatch) COM_INTERFACE_ENTRY(ISupportErrorInfo) //add com:COM_INTERFACE_ENTRY(IObjectSafety) here COM_INTERFACE_ENTRY(IObjectSafety) END_COM_MAP() // ISupportsErrorInfo STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid); // IDogKey public: STDMETHOD(GetSerialNumber)(/*[in]*/BSTR cUserPassword,/*[out,retval]*/long *serialNumber); STDMETHOD(SetDataToDog)(/*[in]*/BSTR cUserPassword,/*[in]*/BSTR usData); STDMETHOD(GetDataFromDog)(/*[in]*/BSTR cUserPassword,/*[out,retval]*/BSTR* usData); }; #endif //__DOGKEY_H_