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


/ Published in: C++
Save to your folder(s)

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.


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.