From: Matrixinline on
Hi All,

I have a service which open a dialog to let user browse the local file
system. The Dialog is not derived from CFileDialog. I have written it.
I have used GetLogicalDrive and CFindFile to list the drives and
files.

Now my User has a Remote location mapped as a drive. But my Dialog
does not show the mapped drive.

Can you please suggest work around so that My File browser dialog
shows the mapped drive.

Thanks
Anup
From: David Lowndes on
>I have a service which open a dialog to let user browse the local file
>system. The Dialog is not derived from CFileDialog. I have written it.
>I have used GetLogicalDrive and CFindFile to list the drives and
>files.
>
>Now my User has a Remote location mapped as a drive. But my Dialog
>does not show the mapped drive.

Can you clarify some points...

What account is your service running under?
Is it set to interact with the desktop?

Usually, a better solution is to have your service communicate with an
interactive GUI application that's started when the user logs on.

Dave
From: Joseph M. Newcomer on
How is you have a service with a user interface? This feature was removed from Windows
with Vista and is no longer available. If you have a service with a UI, then you have a
service that will only run on dead versions of Windows.

Note that a service is logged in under some account established when the service is
created (usually LocalService). Drive mappings are established by login, so a user's
mapped drives apply ONLY to that particular login session and cannot be applied to any
other logged-in session, such as a service. Logical drive letters are NOT a property of
the system, or the file server, but ONLY of the logged-in user. If the user is accessing
a service (how?), the service cannot possibly know or discover what drives are mapped by
the logged-in user.

So the answer is: there is no "workaround" because you are asking for something that is
simply impossible.
joe

On Mon, 3 May 2010 04:04:02 -0700 (PDT), Matrixinline <anup.kataria(a)gmail.com> wrote:

>Hi All,
>
>I have a service which open a dialog to let user browse the local file
>system. The Dialog is not derived from CFileDialog. I have written it.
>I have used GetLogicalDrive and CFindFile to list the drives and
>files.
>
>Now my User has a Remote location mapped as a drive. But my Dialog
>does not show the mapped drive.
>
>Can you please suggest work around so that My File browser dialog
>shows the mapped drive.
>
>Thanks
>Anup
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Hector Santos on
Matrixinline wrote:

> Hi All,
>
> I have a service which open a dialog to let user browse the local file
> system. The Dialog is not derived from CFileDialog. I have written it.
> I have used GetLogicalDrive and CFindFile to list the drives and
> files.
>
> Now my User has a Remote location mapped as a drive. But my Dialog
> does not show the mapped drive.
>
> Can you please suggest work around so that My File browser dialog
> shows the mapped drive.

In addition to Joe's note....

I would swear I recall seeing a message where NETBIOS-based shared
drives is not available at the service level until the user logs into
the desktop. It is at the moment where the drives are mapped. I have
not verified this but I have a "check out" note to do so when I reach
that point.

Again, I recall reading some discussion where this was pointed out. It
could a new OS version related security issue which might explain I
don't recall a customer incident related to shared drives and our
application running as a service with no desktop user active.

Just guessing here:

If this is the case, then your service might be doing some
initializing for available drives and using this static "service
startup" information rather than dynamically getting the available
drives upon request (at the desktop level.

--
HLS