Click here to Skip to main content
Click here to Skip to main content
Go to top

CCeFileFind - A FileFind class for Windows CE

, 21 Nov 2001
Rate this:
Please Sign up or sign in to vote.
CCeFileFind - A FileFind class for Windows CE.

Introduction

This class was originally posted by Waseem Anis on CodeGuru. However after misunderstanding how the class works and finding (and subsequently fixing) several bugs, I decided that Waseem's article and code although excellent, needed some clarification.

As most Windows CE programmers know, Microsoft has not provided a FindFile MFC class to wrap the Windows CE FindFile APIs. This functionality lacking in the Windows CE SDK is provided in the CCeFileFind.

Using the class

The example code below demonstrates using the CeFileFind class to determine the device's storage card directory.

CCeFileFind p_ff;
BOOL bFilesFound =  p_ff.FindFile(_T("\\*"));

while(bFilesFound)
{
    bFilesFound = p_ff.FindNextFile();
    if(p_ff.IsTemporary() && p_ff.IsDirectory())
    {
        m_csDirectoryName = p_ff.GetFileName();
        break;
    }
}

NB. Note how FindFile is executed first, then FindNextFile is executed and then GetFileName is executed. FindFile and FindNextFile must occur in the demonstrated order. Any further questions or queries, feel free to contact me.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Ray Kinsella
Web Developer
Ireland Ireland
A very confused human being, a slightly less confused developer.

Comments and Discussions

 
QuestionOne File is always lost PinmemberTEisenhauer25-Feb-08 20:15 
GeneralWin32 not MFC version PinsussAnonymous7-Dec-04 13:43 
GeneralDrive mapping under CE PinmemberAlex Evans23-Sep-04 18:23 
GeneralRe: Drive mapping under CE PinmemberRay Kinsella23-Sep-04 22:41 
GeneralRe: Drive mapping under CE PinmemberAlex Evans24-Sep-04 17:31 
GeneralLink Error Help ned Pinmemberpakolaw26-May-03 22:08 
GeneralRe: Link Error Help ned PinmemberMDR26-May-03 23:20 
GeneralRe: Link Error Help ned Pinmemberpakolaw26-May-03 23:29 
GeneralRe: Link Error Help ned PinmemberMDR26-May-03 23:35 
GeneralRe: Link Error Help ned Pinmembereditfmah8-May-07 11:52 
GeneralRe: Link Error Help ned Pinmemberzaphoed13-Mar-08 0:31 
GeneralBug Pinmembermachiav16-Dec-02 22:28 
GeneralRe: Bug PinmemberRay Kinsella16-Dec-02 22:32 
GeneralRe: Bug Pinmemberpiemelvriend22-Jul-04 22:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 22 Nov 2001
Article Copyright 2001 by Ray Kinsella
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid