?
Solved

Mapping Network Drives

Posted on 2000-02-21
14
Medium Priority
?
227 Views
Last Modified: 2010-04-04
Hi ho.

I'm using Wise InstallMaster v8.01 to deploy an application writting in Delphi 5.  I need to make it display a Map Network Drive dialog box.  Does anyone know what DLL (ie, SHELL32.DLL, KERNEL386.EXE etc) the fuction is stored in, and what parameters I need to pass to get this dialog box to display?  I know this isn't a Delphi related questions, but you guys are all just so smart ;)

Thanks for any help,

Stu.
0
Comment
Question by:Stuart_Johnson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
  • 2
  • +1
14 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 400 total points
ID: 2544211
Hi ,
couple of ways:

easy way:

procedure TForm1.Button2Click(Sender: TObject);
begin
  WNetConnectionDialog(Handle,RESOURCETYPE_DISK);
   {RESOURCETYPE_PRINT for printer}
end;


second way ( slightly longer ;-)

procedure TForm1.Button3Click(Sender: TObject);
var
 NetResource: TNetResource;
  begin
  { fill our TNetResource record structure }
 NetResource.dwType       := RESOURCETYPE_DISK;
 NetResource.lpLocalName  := 'S:';
 NetResource.lpRemoteName := '\\server\public';
 NetResource.lpProvider   := '';
{ map our network drive using our TNetResource
 record structure }
 WNetAddConnection2(NetResource,
      '', {Clave o vacio /Password or empty}
      '', {Nombre del usurio o vacio/User name o vacio}
 CONNECT_UPDATE_PROFILE);
   end;
{In that example, we will connect '\\server\public' to S:,
 without username neither password }

Regards Barry
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2544223
Argh, Inthe, you're quick :-)

WNetConnectionDialog(Handle, RESOURCETYPE_DISK);

Be sure to check the result of the WNetConnectionDialog, since according to
the docs it will return ERROR_NO_NETWORK on non-networked computers

Zif

0
 
LVL 17

Expert Comment

by:inthe
ID: 2544232
mmm..i just re-red the question and wondering if that was correct for what you needed?

WNetConnectionDialog comes from mpr.dll
it is declared in windows.pas
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 17

Expert Comment

by:inthe
ID: 2544237
hi zif ,gotta be quick with you and raymond around ;-)
0
 
LVL 6

Author Comment

by:Stuart_Johnson
ID: 2544278
Hi all,

Thanks for the mega fast replies.  Barry, what you originally specified would have been useful if I was calling it out of Delphi, but as mentioned, I am actually calling it directly out of Wise.  Your second comment was the answer I was looking for.

To call this function, I need to RUNDLL32.EXE.  However, if I type in (at the DOS prompt):

RUNDLL32 C:\WINDOWS\SYSTEM\MPR.DLL WNetConnectionDialog

I get no dialog displayed.  Does anyone have any idea how I can display this dialog at all using RUNDLL32?

Thanks for you help!

Stu.
0
 
LVL 17

Expert Comment

by:inthe
ID: 2544866
hello
typing this below works:

RUNDLL32 user,wnetconnectdialog

doesnt seem to need mpr.dll ?
0
 
LVL 2

Expert Comment

by:craig_capel
ID: 2546016
Hi.... The Network Dialog.... hmmm i have seen that before i think... but this is your best bet...

COMDLG32.DLL, i think this is where you get it from, and there are more in here like the dialog box to shutdown windows and more stuff like that....

Barry, You may know what to do with this link.... i gave up trying to call a dll a long time ago :)  but Stuart, i think your answer is here...


http://www.geocities.com/SiliconValley/4942/common.html
0
 
LVL 2

Expert Comment

by:craig_capel
ID: 2546032
ok forget the answer being in there... you may find the other dialogs usefull :)  i am going to have to read all the questions first not just parts of them...
0
 
LVL 17

Expert Comment

by:inthe
ID: 2547371
hi craig ,i guessed you misinterpret my comment..i was assuming ineeded to put the path to mpr.dll but seems not.

typing this below at dos prompt etc works fine to show the dialog:

RUNDLL32 user,wnetconnectdialog

0
 
LVL 6

Author Comment

by:Stuart_Johnson
ID: 2548207
Thanks Barry!  Much appreciated.  Works like a dream.

Cheers!!

Stu.
0
 
LVL 17

Expert Comment

by:inthe
ID: 2548224
great to hear ;-)
0
 
LVL 2

Expert Comment

by:craig_capel
ID: 2550390
inthe.... Did you check out these dialogs?.... You may find them intrsting if nothing else....

http://www.geocities.com/SiliconValley/4942/common.html
0
 
LVL 17

Expert Comment

by:inthe
ID: 2552925
hi craig ,
thanks for link but i already have components for all these shell dialogs .. ;-)
0
 
LVL 2

Expert Comment

by:craig_capel
ID: 2553952
If i only had the yahoo symbols...... :P

Craig C.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question