|
-
Sep 1st, 2000, 07:11 AM
#1
Thread Starter
Hyperactive Member
Anyone understand this problem? Trying to map a network drive
Module
Declare Function WNetAddConnection Lib "mpr.dll" Alias "WNetAddConnectionA" (ByVal lpszNetPath As String, ByVal lpszstrPassword As String, ByVal lpszLocalName As String) As Long
Load form
Dim strLocalDriveLetter As String
Dim strPassword As String
Dim strNetworkPathName As String
strLocalDriveLetter = "T:" 'Local drive letter to be mapped
strPassword = "god" 'specify network password if required
strNetworkPathName = "\\lab_techs\c" 'path to network drive
If WNetAddConnection(strNetworkPathName, strPassword, strLocalDriveLetter) > 0 Then
MsgBox ("An Error occurred mapping the drive")
Else
MsgBox ("Drive successfully mapped!")
End If
-RaY
VB .Net 2010 (Ultimate)
-
Sep 1st, 2000, 07:14 AM
#2
Guru
Looks good! 
What isn't working?
-
Sep 1st, 2000, 07:22 AM
#3
Thread Starter
Hyperactive Member
Don't know
Just says error loading dll
-RaY
VB .Net 2010 (Ultimate)
-
Sep 1st, 2000, 07:29 AM
#4
Addicted Member
Hi,
Have you tried doing a search for the file on your machine? (on mine it's located in: C:\WINNT\System32).
If you can't find it then that's your problem.
If it is there then...
Shaun
From MSDN
Error in loading dll (Error 48)
This error has the following causes and solutions:
The file isn't DLL-executable.
If the file is a source-text file, it must be compiled and linked to DLL executable form.
The file isn't a Microsoft Windows DLL.
Obtain the Microsoft Windows DLL equivalent of the file.
The file is an early Microsoft Windows DLL that is incompatible with Microsoft Windows protect mode.
Obtain an updated version of the DLL.
The DLL references another DLL that isn't present.
Obtain the referenced DLL and make it available to the other DLL.
The DLL or one of the referenced DLLs isn't in a directory specified by your path.
Move the DLL to a referenced directory or place its current directory on the path.
[Edited by S@NSIS on 09-01-2000 at 08:36 AM]
Web/Application Developer
VB6 Ent (SP5), Win 2000,SQL Server 2000
-
Sep 1st, 2000, 07:32 AM
#5
Guru
"Error loading DLL" is an error I never ran into. 
If it's a runtime error, what's the error number?
Make the error message appear, there should be a number there.
-
Sep 1st, 2000, 07:36 AM
#6
Member
You could try the LoadLibrary function and FreeLibrary will release it when your done.
Public Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Public Declare Function FreeLibrary Lib "kernel32" Alias "FreeLibrary" (ByVal hLibModule As Long) As Long
Phil
VB 6, SQL, Java, AutoLISP, Avenue and on a good day AML
-
Sep 1st, 2000, 07:44 AM
#7
Thread Starter
Hyperactive Member
AHHHH
It high lights this
If WNetAddConnection(strNetworkPathName, strPassword, strLocalDriveLetter) > 0 Then
and then all it says is
"error in loading dll"
-RaY
VB .Net 2010 (Ultimate)
-
Sep 1st, 2000, 07:46 AM
#8
Thread Starter
Hyperactive Member
And...
mpr.dll is in the windows system folder, however my version is from 8/24/96....... I do have vb though so that might be over its time hehehe. If you have a newer version send it to [email protected], i can give it a shot.
-RaY
VB .Net 2010 (Ultimate)
-
Sep 1st, 2000, 07:59 AM
#9
Addicted Member
On it's way to you
Web/Application Developer
VB6 Ent (SP5), Win 2000,SQL Server 2000
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|