// NextLink.h : Declaration of the CNextLink #ifndef __NEXTLINK_H_ #define __NEXTLINK_H_ #include "resource.h" // main symbols #include // Active Server Pages Definitions #include "LinkFile.h" #include "lock.h" #include "context.h" ///////////////////////////////////////////////////////////////////////////// // CNextLink class ATL_NO_VTABLE CNextLink : public CComObjectRootEx, public CComCoClass, public ISupportErrorInfo, public IDispatchImpl { public: CNextLink() { } public: DECLARE_REGISTRY_RESOURCEID(IDR_NEXTLINK) DECLARE_GET_CONTROLLING_UNKNOWN() BEGIN_COM_MAP(CNextLink) COM_INTERFACE_ENTRY(INextLink) COM_INTERFACE_ENTRY(IDispatch) COM_INTERFACE_ENTRY(ISupportErrorInfo) COM_INTERFACE_ENTRY_AGGREGATE(IID_IMarshal, m_pUnkMarshaler.p) END_COM_MAP() HRESULT FinalConstruct() { return CoCreateFreeThreadedMarshaler( GetControllingUnknown(), &m_pUnkMarshaler.p ); } void FinalRelease() { m_pUnkMarshaler.Release(); } // ISupportsErrorInfo STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid); // INextLink public: STDMETHOD(get_About)(/*[out, retval]*/ BSTR *pVal); STDMETHOD(get_GetListIndex)(BSTR bstrLinkFile, /*[out, retval]*/ int *pVal); STDMETHOD(get_GetListCount)(BSTR bstrLinkFile, /*[out, retval]*/ int *pVal); STDMETHOD(get_GetNthDescription)(BSTR bstrLinkFile, int nIndex, /*[out, retval]*/ BSTR *pVal); STDMETHOD(get_GetNthURL)(BSTR bstrLinkFile, int nIndex, /*[out, retval]*/ BSTR *pVal); STDMETHOD(get_GetPreviousDescription)(BSTR bstrLinkFile, /*[out, retval]*/ BSTR *pVal); STDMETHOD(get_GetPreviousURL)(BSTR bstrLinkFile, /*[out, retval]*/ BSTR *pVal); STDMETHOD(get_GetNextDescription)(BSTR bstrLinkFile, /*[out, retval]*/ BSTR *pVal); STDMETHOD(get_GetNextURL)(BSTR, /*[out, retval]*/ BSTR *pVal); static void ClearLinkFiles(); static void RaiseException( LPOLESTR ); static void RaiseException( UINT ); private: CLinkFilePtr LinkFile( UINT, BSTR ); CLinkFilePtr LinkFile( CContext&, UINT, BSTR ); bool GetPage( CContext&, String& ); bool GetFileAndPage( UINT, BSTR, CLinkFilePtr&, String& ); typedef TSafeStringMap LinkFileMapT; CComPtr m_pUnkMarshaler; static LinkFileMapT s_linkFileMap; }; #endif //__NEXTLINK_H_