// Created by Larry Leonard, Definitive Solutions, Inc. #if !defined(AFX_MYDEVSTUDIO_H__B5DC7733_0583_11D4_9917_00508B025F16__INCLUDED_) #define AFX_MYDEVSTUDIO_H__B5DC7733_0583_11D4_9917_00508B025F16__INCLUDED_ #pragma once ///////////////////////////////////////////////////////////////////////////// // Forward Declarations class IApplication; class IDocuments; ///////////////////////////////////////////////////////////////////////////// // MyDevStudio - Create this object on the heap or the stack, but not as a // "static" object (it would get destructed after the OLE // libraries have been released, I believe, causing a GPF). class MyDevStudio : public CCmdTarget { DECLARE_DYNCREATE(MyDevStudio) // Construction. public: MyDevStudio(); virtual ~MyDevStudio(); // Deliberately declared but not defined. private: MyDevStudio(const MyDevStudio& rhs); MyDevStudio& operator=(const MyDevStudio& rhs); // Operations. public: // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(MyDevStudio) //}}AFX_VIRTUAL // These initialize and connect to a Dev Studio instance. bool IsDeveloperStudioInstalled(CLSID& idMsDev) const; bool IsRunningInstance(IUnknown** ppUnkSent = NULL) const; bool ConnectToInstance(); bool IsConnectedToInstance(); void Activate() const; // Open a file knowing only its 255.3 file name (not whole path). bool OpenFile(const CString& sFileName); // Goto the specified line in the currently open file. bool GoToLine(int nLine); // Implementation. protected: // Generated message map functions //{{AFX_MSG(MyDevStudio) // NOTE - the ClassWizard will add and remove member functions here. //}}AFX_MSG DECLARE_MESSAGE_MAP() // Load the DSProject objects from the DSW's DSP files. bool LoadProjects(); // Called by the dtor and whenever we lose connection. void Cleanup(); // Data. private: CString m_sDswPath; // Location of Workspace file. IApplication* m_pIApp; // Application interface. IDocuments* m_pIDocs; // Documents interface. CObList m_olProjects; // List of Project objects. }; ///////////////////////////////////////////////////////////////////////////// // DSProject - Represents a DSP file. Used only by MyDevStudio class, not // by the client programmer. class DSProject : public CCmdTarget { friend class MyDevStudio; DECLARE_DYNCREATE(DSProject) // Construction. public: DSProject(); virtual ~DSProject(); // Deliberately declared but not defined. private: DSProject(const DSProject& rhs); DSProject& operator=(const DSProject& rhs); // Operations. public: // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(DSProject) //}}AFX_VIRTUAL // Implementation. protected: // Generated message map functions //{{AFX_MSG(DSProject) // NOTE - the ClassWizard will add and remove member functions here. //}}AFX_MSG DECLARE_MESSAGE_MAP() bool Initialize(const CString& sProjectName, CStdioFile& fileDsw); bool ParseDspFile(); bool PathForFile(const CString& sFileName, CString& sFilePath) const; // Data. private: CString m_sDspPath; // Path of the DSP file that // corresponds to this object. CStringList m_slFiles; // The list of files, stored // in all lowercase letters. }; //{{AFX_INSERT_LOCATION}} // Microsoft Developer Studio will insert additional declarations immediately before the previous line. #endif // !defined(AFX_MYDEVSTUDIO_H__B5DC7733_0583_11D4_9917_00508B025F16__INCLUDED_)