Two possibilities I know of:
- API Function FindFirstFile with the following sintax(MSDN)
HANDLE FindFirstFile(
LPCTSTR lpFileName, // file name
LPWIN32_FIND_DATA lpFindFileData // data buffer
);
- in MFC Construct an object of type CFindFile then call its member function FindFile with the syntax more straight:
virtual BOOL FindFile( LPCTSTR pstrName = NULL, DWORD dwUnused = 0 );
Hope this helps, s-)
Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...
I use
[tt]
OFSTRUCT ofs;
if :OpenFile(fname,&ofs,OF_EXIST)!=HFILE_ERROR)
{ // it exists
}
else
{ // it doesn't exist
}
[/tt]
, but I guess I'm just that kind of guy.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.