PC Review


Reply
Thread Tools Rate Thread

CeFindAllFiles

 
 
Jody Gelowitz
Guest
Posts: n/a
 
      10th Sep 2003
Has anybody gotten the CeFindAllFiles API call to work? If so, how? I am
trying to use this to retrieve a list of directories or files and have not
been able to get anything. The connection with the device is active as I am
able to transfer files to the PC if I know the file path ahead of time.
Here is what I have:

[DllImport("rapi.dll", CharSet=CharSet.Unicode)]

internal static extern int CeFindAllFiles(string szPath, uint dwFlags, ref
int lpdwFoundCount,ref CE_FIND_DATA[] ppFindDataArray);



[StructLayout(LayoutKind.Sequential)]

public struct CE_FIND_DATA

{

public uint dwFileAttributes;

public int ftCreationTime;

public int ftCreationTime2;

public int ftLastAccessTime;

public int ftLastAccessTime2;

public int ftLastWriteTime;

public int ftLastWriteTime2;

public int nFileSizeHigh;

public int nFileSizeLow;

public int dwOID;

[MarshalAs(UnmanagedType.ByValTStr, SizeConst=260)] public string cFileName;

}



public enum RAPIFileAttributes : uint

{

ReadOnly = 0x0001,

Hidden = 0x0002,

System = 0x0004,

Directory = 0x0010,

Archive = 0x0020,

InROM = 0x0040,

Normal = 0x0080,

Temporary = 0x0100,

Sparse = 0x0200,

ReparsePt = 0x0400,

Compressed = 0x0800,

ROMModule = 0x2000

}



public CE_FIND_DATA[] GetAllFiles(string p_strStartPath, bool
p_bolGetDirectories)

{

CE_FIND_DATA[] retData = new CE_FIND_DATA[1];

RAPIFileAttributes intFlags;

int intFound=0;

int ret=0;

if(p_bolGetDirectories)

{

intFlags = RAPIFileAttributes.Directory;

}

else

{

intFlags = RAPIFileAttributes.Normal;

}

uint uintFlag;

uintFlag=(uint)intFlags;

ret=CeFindAllFiles(p_strStartPath, uintFlag, ref intFound, ref retData);

if(ret == 0)

{

throw new Exception("Could not get file attributes");

}

return retData;

}





Thanks,

Jody


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RAPI CeFindAllFiles S. J. Brooks Microsoft Dot NET Compact Framework 0 25th Jul 2003 09:46 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:33 PM.