Re: subst
On 26 Mar, 18:49, "Carl Daniel [VC++ MVP]"
<cpdaniel_remove_this_and_nos...@mvps.org.nospam> wrote:
"RedLars" <Liverpool1...@gmail.com> wrote
Here is the API used to check if a directory exists. This returns
false, and GetLastError is equal ERROR_PATH_NOT_FOUND.
bool DirectoryExist(
CString sPath)
{
DWORD nAttributes = GetFileAttributes(sPath);
if (nAttributes == 0xFFFFFFFF)
{
return false;
}
else if (nAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
return true;
}
return false;
}
OK, fine. What, exactly, are the circumstances under which you don't get
the value you expected? Are you trying to access a SUBST drive from a
service (or any process that runs under different credentials), for example?
This article may shed some light on your problem:
http://msdn2.microsoft.com/en-us/library/aa363908.aspx
-cd- Skjul sitert tekst -
- Vis sitert tekst -
An application I've got needs to access a subst drive to use a few
files (xml, dll). The problem is, the application cant find any file
or directory in the subst drive. They dont seem to exists from the
application point of view (api above fails) even though the subst
drive is perfectly visible and usable from windows explorer. This does
not appear to be an access problem since the app is run as
administrator.