
Netware 3.1 , Windows 3.1 and VB
Quote:
>Does anyone know how to write some VB code that will make a windows 3.1 PC
>attach to a server and map a network drive in Novel Netware 3.1 so that a
>program on that server is run automatically?
You can use WNetAddConnection to map a network drive to a Windows letter
drive (like "H:"). You can use WNetGetConnection to see how a drive is
mapped, and (for completeness, there are only different 3 calls),
WNetCancelConnection to remove the mapping.
You can then just use Shell to run the program from the network drive.
So, IMO, just an icon that does this isn't possible. You need a little
local program that does this.
WIN31API.TXT doesn't contain the declarations. Here they are from the
file accompaning Appleman's book:
Declare Function WNetAddConnection% Lib "User" (ByVal lpszNetPath$,
ByVal lpszPassword$, ByVal lpszLocalName$)
Declare Function WNetCancelConnection% Lib "User" (ByVal lpszName$,
ByVal fForce%)
Declare Function WNetGetConnection% Lib "User" (ByVal lpszLocalName$,
ByVal lpszRemoteName$, cbRemoteName%)
I think you better start experimenting with WNetGetConnection.
lpszLocalname$ is the drive letter (plus colon, if you like),
lpszRemoteName$ is the receiving buffer, cbRemoteName% is the size of
this buffer.
In WNetAddConnection, feed this value into lpszNetPath$. lpszLocalName$
is the new drive letter, lpszPassword$ is the required password to
login, empty string if none required.
HTH,
Bart.