Click here to Skip to main content
15,879,326 members
Articles / Desktop Programming / MFC

Syntax colorizing with Speller engine using TOM and CSAPI

Rate me:
Please Sign up or sign in to vote.
4.89/5 (17 votes)
12 Nov 20044 min read 101.2K   3.1K   46  
Syntax colorizing with Speller engine using TOM and CSAPI.
// registry.h: classe permettant l'acc�s � la base de registres
//

#ifndef	_REGISTRY_H
#define	_REGISTRY_H

#define REGSKYMAP "HKEY_CURRENT_USER/Software/MAKETOD2"
#include <afxtempl.h>

class CKey
{
	public:
				CKey(LPCSTR path,BOOL *created=0,CKey *parent=0);
				~CKey();
		HKEY	GetHKEY(void);
		HKEY GetLast()
		{
			if(m_child==0) return m_key;
			return m_child->GetLast();
		}

	private:
		CKey	*m_child;
		HKEY	m_key;
};


class	CRegistry
{
	CString	m_path;

public:
	CRegistry(LPCSTR path=REGSKYMAP);
	int		ReadKeyInt(LPCSTR name,int *r,int default_value);
	LPCSTR 	ReadKeyString(LPCSTR name,LPSTR r,LPCSTR default_value);
	BOOL	WriteKeyInt(LPCSTR name,int data);
	BOOL	WriteKeyString(LPCSTR name,LPCSTR data);
	int		ReadKey(LPCSTR name,int default_value);
	LPCSTR	ReadKey(LPCSTR name,LPCSTR default_value);
	BOOL	WriteKey(LPCSTR name,int value);
	BOOL	WriteKey(LPCSTR name,LPCSTR value);
	BOOL	DeleteKey(LPCSTR name);
	BOOL	SetPath(LPCSTR path);
	BOOL	TestKey(LPCSTR name);
	float   ReadKey(LPCSTR name,float default_value);
	BOOL    WriteKey(LPCSTR name,float default_value);
	BOOL	EnumKeys(LPCSTR name,CArray<CString,CString> & m);
	BOOL	EnumValue(LPCSTR name,CArray<CString,CString> & m);
	
};

class PlgResourceHandle
{
public :
	PlgResourceHandle( AFX_EXTENSION_MODULE &dll )
	{
		m_OldInst = AfxGetResourceHandle() ;
		AfxSetResourceHandle( dll.hResource ) ;
	}
	~PlgResourceHandle() 
	{
		AfxSetResourceHandle( m_OldInst ) ;
	}
private :
	HINSTANCE	m_OldInst ;
} ;
#endif

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
France France
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions