///////////////////////////////////////////////////////////////////// // getMap.h - component for Midterm question #1 // // FillMap fills map with directory info // // GetMap returns map elements in BSTR // // // // Jim Fawcett, CSE775 - Distributed Objects, Spring 2005 // ///////////////////////////////////////////////////////////////////// #pragma once #include "resource.h" // main symbols #include #include #include ///////////////////////////////////////////////////////////////////// // Only this part required for Midterm.Q1 [ object, uuid("A958702A-75BE-457E-A8CB-E3AC68359DBA"), dual, helpstring("IgetMap Interface"), pointer_default(unique) ] __interface IgetMap : IDispatch { [id(1), helpstring("method FillMap")] HRESULT FillMap([in] BSTR path); [id(2), helpstring("method GetMap")] HRESULT GetMap([out,retval] BSTR* mapData); }; ///////////////////////////////////////////////////////////////////// [ coclass, threading("apartment"), vi_progid("Q1.getMap"), progid("Q1.getMap.1"), version(1.0), uuid("D770FA25-F540-4BB4-9310-D8E671AF387E"), helpstring("getMap Class") ] class ATL_NO_VTABLE CgetMap : public IgetMap { public: typedef std::list< std::string > FileList; typedef std::map< std::string, FileList > DirMap; CgetMap() { } DECLARE_PROTECT_FINAL_CONSTRUCT() HRESULT FinalConstruct() { return S_OK; } void FinalRelease() { } private: DirMap dirMap_; public: STDMETHOD(FillMap)(BSTR path); STDMETHOD(GetMap)(BSTR* mapData); };