Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WNetGetConnection woes
Message
De
20/05/2011 15:43:18
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Problèmes
Titre:
WNetGetConnection woes
Versions des environnements
Environment:
VB 9.0
OS:
Windows XP SP2
Divers
Thread ID:
01511311
Message ID:
01511311
Vues:
92
I am getting an unexpected error when calling a know API function. "Unable to find an entry point named 'WNetGetConnection' in DLL 'mpr.dll'."

Here is the text code that reproduces the error on my machine. Am I missing some Reference or something? All web articles make no mention of needing anything but the declaration at the top of the code. (p.s. the mapped drive does exist.)
Imports System.IO


Module Module1
    Public Declare Function WNetGetConnection Lib "mpr.dll" Alias "WNetGetConnection" (ByVal localName As String, ByVal remoteName As Text.StringBuilder, ByRef length As Integer) As Integer

    Sub Main()


        Dim lcDrive As String = "Y:"
        Dim lnresult As Integer = 0

        Dim lcUNCBuffer = New Text.StringBuilder(1025)
        Dim lnLength = 1024

        lnresult = WNetGetConnection(lcDrive, lcUNCBuffer, lnLength)
        Console.WriteLine(lnresult)
        Console.WriteLine(lcUNCBuffer.ToString)
    End Sub

End Module
Greg Reichert
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform