Click here to Skip to main content
15,886,519 members
Articles / Web Development / HTML

A Comprehensive CE Class Library to Replace ATL and MFC

Rate me:
Please Sign up or sign in to vote.
4.48/5 (14 votes)
4 Oct 2000CPOL 279K   998   70  
A collection of classes for CE that do not use ATL or MFC, plus an FTP client, database viewer, and sample application that solves beam deflection equations.
#ifndef __FindFile_h__
#define __FindFile_h__

#include <projects.h>

class CeFindFile: public WIN32_FIND_DATA
{
private:
	HANDLE m_hFind;
public:
	CeFindFile()
		{ m_hFind = INVALID_HANDLE_VALUE;	}
	~CeFindFile()
		{ ::FindClose(m_hFind); }

	bool FindFirst(LPCTSTR lpFileName)
		{
			if (INVALID_HANDLE_VALUE != m_hFind)
				::FindClose(m_hFind);
			m_hFind = ::FindFirstFile(lpFileName, this);
			return (INVALID_HANDLE_VALUE == m_hFind) ? false: true;
		}
	BOOL FindNext()
		{ return ::FindNextFile(m_hFind, this); }

	bool FindFirstFlash()
		{
			if (INVALID_HANDLE_VALUE != m_hFind)
				::FindClose(m_hFind);
			m_hFind = ::FindFirstFlashCard(this);
			return (INVALID_HANDLE_VALUE == m_hFind) ? false: true;
		}
	BOOL FindNextFlash()
		{ return ::FindNextFlashCard(m_hFind, this); }


	bool IsNormal()		{ return (FILE_ATTRIBUTE_NORMAL & dwFileAttributes) ? true: false; }
	bool IsArchive()	{ return (FILE_ATTRIBUTE_ARCHIVE & dwFileAttributes) ? true: false; }
	bool IsDirectory()	{ return (FILE_ATTRIBUTE_DIRECTORY & dwFileAttributes) ? true: false; }
	bool IsCompressed()	{ return (FILE_ATTRIBUTE_COMPRESSED & dwFileAttributes) ? true: false; }
	bool IsEncrypted()	{ return (FILE_ATTRIBUTE_NORMAL & dwFileAttributes) ? true: false; }
#ifdef _WIN32_WCE
	bool IsInROM()		{ return (FILE_ATTRIBUTE_INROM & dwFileAttributes) ? true: false; }
	bool IsXIP()		{ return (FILE_ATTRIBUTE_ROMMODULE & dwFileAttributes) ? true: false; }
#endif
	bool IsTemporary()	{ return (FILE_ATTRIBUTE_TEMPORARY & dwFileAttributes) ? true: false; }
	bool IsHidden()		{ return (FILE_ATTRIBUTE_HIDDEN & dwFileAttributes) ? true: false; }
	bool IsOffLine()	{ return (FILE_ATTRIBUTE_NORMAL & dwFileAttributes) ? true: false; }
	bool IsReadOnly()	{ return (FILE_ATTRIBUTE_READONLY & dwFileAttributes) ? true: false; }
	bool IsSystem()		{ return (FILE_ATTRIBUTE_SYSTEM & dwFileAttributes) ? true: false; }
	bool IsStorageCard(){ return IsTemporary() && IsDirectory(); }

		
	// FILE_ATTRIBUTE_ROMSTATICREF
	// FILE_ATTRIBUTE_ROMMODULE
};

#endif // __FindFile_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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions