Click here to Skip to main content
Licence CPOL
First Posted 21 Aug 2001
Views 77,189
Downloads 129
Bookmarked 30 times

CCeFileFind - A FileFind class for Windows CE

By | 21 Nov 2001 | Article
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)

About the Author

Ray Kinsella

Web Developer

Ireland Ireland

Member

A very confused human being, a slightly less confused developer.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
QuestionOne File is always lost PinmemberTEisenhauer20:15 25 Feb '08  
GeneralWin32 not MFC version PinsussAnonymous13:43 7 Dec '04  
GeneralDrive mapping under CE PinmemberAlex Evans18:23 23 Sep '04  
GeneralRe: Drive mapping under CE PinmemberRay Kinsella22:41 23 Sep '04  
GeneralRe: Drive mapping under CE PinmemberAlex Evans17:31 24 Sep '04  
GeneralLink Error Help ned Pinmemberpakolaw22:08 26 May '03  
GeneralRe: Link Error Help ned PinmemberMDR23:20 26 May '03  
GeneralRe: Link Error Help ned Pinmemberpakolaw23:29 26 May '03  
GeneralRe: Link Error Help ned PinmemberMDR23:35 26 May '03  
GeneralRe: Link Error Help ned Pinmembereditfmah11:52 8 May '07  
GeneralRe: Link Error Help ned Pinmemberzaphoed0:31 13 Mar '08  
GeneralBug Pinmembermachiav22:28 16 Dec '02  
GeneralRe: Bug PinmemberRay Kinsella22:32 16 Dec '02  
GeneralRe: Bug Pinmemberpiemelvriend22:38 22 Jul '04  

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.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120528.1 | Last Updated 22 Nov 2001
Article Copyright 2001 by Ray Kinsella
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid