Click here to Skip to main content
15,894,017 members
Articles / Desktop Programming / ATL

Visual Studio Favorites

Rate me:
Please Sign up or sign in to vote.
2.00/5 (3 votes)
16 Mar 20033 min read 52.8K   710   14  
Add shortcuts, favorites, and more to Visual Studio.
// ConfigurationFile.h: interface for the CConfigurationFile class.
// This is designed to be derived from in order to load stuff.
//
//////////////////////////////////////////////////////////////////////

#ifndef __CONFIGURATIONFILE_H_
#define __CONFIGURATIONFILE_H_

enum ITEM_TYPES
{
	IT_UNKNOWN = -1,
	IT_FIRST = 0,
	IT_LINK =0 ,
	IT_FILE,
	IT_EXE,
	IT_BSC,
	IT_FOLDER,
	IT_CONFIG,
	IT_BREAK,
	IT_IEFAVSFOLDER,
	IT_HELPERENDOFFOLDER,
	TOTAL_NUM_ICONS,
	IT_ENDOFLIST=IT_HELPERENDOFFOLDER,
};

class CConfigurationFile  
{
public:
	CConfigurationFile();
	virtual ~CConfigurationFile();

	virtual void Load();
	virtual void LoadFromXmlDoc(IXMLDOMDocument *pXmlDoc);
	virtual void Save();
	virtual void SaveToXmlDoc(IXMLDOMDocument *pXmlDoc);

	ITEM_TYPES 	GetItemSpecifics(IXMLDOMElement *pElm,char *pTextBuffer) const 
	{
		CComVariant	textVar;
		if (pElm!=NULL)
		{
			pElm->getAttribute(_bstr_t("title"),&textVar);
			AtlW2AHelper(pTextBuffer,textVar);
			return GetItemType(pElm);
		}
		return IT_UNKNOWN;
	}
	
	ITEM_TYPES	GetItemType(IXMLDOMElement *pElm) const;

	static const char *GetTypeText(const ITEM_TYPES iType,const bool verbalText);

protected:
// These functions by default just go into AddItem
	virtual bool AddItem(IXMLDOMElement *pElm,const ITEM_TYPES itemType) { return true; }
	virtual bool PostAddFolderItem(IXMLDOMElement *pElm,const bool fHadChildren) { return true; }	// base does nothing; config tree needs this

	virtual bool AddUnknownItem(IXMLDOMNode *pItem) { return true; }

	virtual void RecursiveLoad(IXMLDOMNode *pChildNode);
	
	virtual bool ChildrenLoad(IXMLDOMNode *pChildNode);

	int	m_menuLoadingDepth;
	char	m_configFilename[MAX_PATH];

	CComPtr<IXMLDOMDocument>	m_pXmlDoc;

};

#endif // !__CONFIGURATIONFILE_H_

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
I work when you don't. Sleep is for wussies.

The answer is no, whatever the question is. You can't have it, you don't need it, and you'd just break it in five minutes if I give it to you anyways.

If you're interested, my web site is at NOPcode.com and has lots of cool stuff with programming and a one-of-a-kind Audio Server.

Comments and Discussions