Yesterday , there occurs a error that some application's Icon cann't show normally when Our project install in a long derectory(nearly 256).we find its root cause is that the way by which we test a file's existence 's not correct, that is to say we use a function that limit the target file only 128. this function is OpenFile .
So I list here:
The old function used :
OFSTRUCT ofs;
if(OpenFile(Dest,ofs, OF_EXIST)== hfile_error)
{
return false;
}
else
{
return true;
}
The new one we used:
DWORD dwAttr = ::GetFileAttributes(lpFileName);
if (dwAttr == 0xffffffff)
{ return FALSE; }
else
{ return TRUE; }
Does any one has some better way to recommand?