Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Map Network Drive dialog box
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00194378
Message ID:
00194524
Views:
23
>>>>>Hello George, you answer helped me out also as I have been having trouble with making sure network resources were available. But my problem is this, I have established that UNC will be used through out my application, so I dont rely on the user being mapped to K: or J:, just that they are logged into the server. I will issue the \\402fs1\data\lotcard\data\drive.dbf to get to my data. So what I would like to know from you is how can I get to the second dialog that comes up from the above, when the user is not logged into the server. The dialog above lets them map a drive to a server resource, but if they are not logged in then it brings up the login screen. How can I just get the login screen to come up as I am using UNC's and mapping is not my problem?
>>>>
>>>>Hi Bret,
>>>>
>>>>According to the SDK: "If the function attempts to make a connection and the provider returns the message ERROR_INVALID_PASSWORD, Windows prompts the user to enter a password and uses the new password in another attempt to make the connection." The value for ERROR_INVALID_PASSWORD is 86. I'll have to investigate the login dialog. It doesn't appear in the WNet... group. Does this help?
>>>
>>>So what your saying is that I should trick it into thinking that the password was invalid and thus the login screen will come up?
>>
>>Not really. The UNC should work provided they've logged in before. If it doesn't then it means that either they haven't or there isn't an available license, etc. This is why I use the WNet... functions rather than UNCs. If I can't make a connection without a password, I can find out why. I'd first assume, of course, that they hadn't logged into a server if the UNC failed, then call the WNetConnectDialog() function to try and establish the connection. It's a relatively simple matter to determine what drives are mapped before and after the call is made, and then compare the results.
>>
>>The only function that I've been able to find that might be of help (LogonUser) applies only to NT. Not being an NT user, I can't test it.
>
>Thanks, that helps. I am sure closer than before.

brett,

I can't get you at the dialog box, but you can use the NetUseAdd() API call under NT at level 2 with a USE_INFO_2 structure to attempt the attachment; you might be able to use WNetAddConnection2() with a local device name of NUL: and a remote share of IPC$ to do the same thing (and it might even fire up the dialog box!) but I haven't tried it. There's sample code in C in the SDK for using NetUseAdd() to make a null attachment to a server to get around the UNC resolution problem, look at the SDK under Code Samples/NetDS/WINNT/NetAPI/NULLSESSION.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform