Results 1 to 9 of 9

Thread: Error loading dll

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    344
    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)

  2. #2
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    Looks good!
    What isn't working?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    344

    Don't know

    Just says error loading dll
    -RaY
    VB .Net 2010 (Ultimate)

  4. #4
    Addicted Member S@NSIS's Avatar
    Join Date
    Aug 2000
    Location
    Stoke-On-Trent, England
    Posts
    243
    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

  5. #5
    Guru Yonatan's Avatar
    Join Date
    Apr 1999
    Location
    Israel
    Posts
    892
    "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.

  6. #6
    Member
    Join Date
    Aug 2000
    Posts
    32

    Smile

    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

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    344

    Angry 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)

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    May 2000
    Posts
    344

    Unhappy 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)

  9. #9
    Addicted Member S@NSIS's Avatar
    Join Date
    Aug 2000
    Location
    Stoke-On-Trent, England
    Posts
    243

    Thumbs up On it's way to you

    Good luck!!
    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
  •  



Click Here to Expand Forum to Full Width