Click here to Skip to main content
11,641,971 members (63,236 online)
Click here to Skip to main content

CCeFileFind - A FileFind class for Windows CE

, 21 Nov 2001 CPOL 85K 260 30
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.

You may also be interested in...

Comments and Discussions

 
QuestionOne File is always lost Pin
TEisenhauer25-Feb-08 20:15
memberTEisenhauer25-Feb-08 20:15 
GeneralWin32 not MFC version Pin
Anonymous7-Dec-04 13:43
sussAnonymous7-Dec-04 13:43 
GeneralDrive mapping under CE Pin
Alex Evans23-Sep-04 18:23
memberAlex Evans23-Sep-04 18:23 
GeneralRe: Drive mapping under CE Pin
Ray Kinsella23-Sep-04 22:41
memberRay Kinsella23-Sep-04 22:41 
GeneralRe: Drive mapping under CE Pin
Alex Evans24-Sep-04 17:31
memberAlex Evans24-Sep-04 17:31 
GeneralLink Error Help ned Pin
pakolaw26-May-03 22:08
memberpakolaw26-May-03 22:08 
GeneralRe: Link Error Help ned Pin
MDR26-May-03 23:20
memberMDR26-May-03 23:20 
GeneralRe: Link Error Help ned Pin
pakolaw26-May-03 23:29
memberpakolaw26-May-03 23:29 
GeneralRe: Link Error Help ned Pin
MDR26-May-03 23:35
memberMDR26-May-03 23:35 
GeneralRe: Link Error Help ned Pin
editfmah8-May-07 11:52
membereditfmah8-May-07 11:52 
GeneralRe: Link Error Help ned Pin
zaphoed13-Mar-08 0:31
memberzaphoed13-Mar-08 0:31 
GeneralBug Pin
machiav16-Dec-02 22:28
membermachiav16-Dec-02 22:28 
GeneralRe: Bug Pin
Ray Kinsella16-Dec-02 22:32
memberRay Kinsella16-Dec-02 22:32 
GeneralRe: Bug Pin
piemelvriend22-Jul-04 22:38
memberpiemelvriend22-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 | Terms of Use | Mobile
Web03 | 2.8.150731.1 | Last Updated 22 Nov 2001
Article Copyright 2001 by Ray Kinsella
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid