Posted By

jimfred on 05/07/09


Tagged

windows WinBase


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

khouser


Simple non-dot.net function to determine if a file exists. Uses the WinBase API.


 / Published in: C++
 

Simple non-dot.net function to determine if a file exists. Uses the WinBase API. Can be used with or without mfc.

Windows, non-dot.net, with or without MFC.

  1. static BOOL FileExists( LPCSTR arg )
  2. {
  3. // Use FindFirstFile in WinBase.h to determine if a file exists.
  4. WIN32_FIND_DATA FindFileData;
  5. HANDLE hFind = FindFirstFile( arg, &FindFileData);
  6. return hFind != INVALID_HANDLE_VALUE;
  7. }

Report this snippet  

You need to login to post a comment.