network path and use of netsharecheck api....

From: N|O (foolish3_at_hotmail.com)
Date: 08/04/04


Date: Wed, 04 Aug 2004 14:50:03 GMT

hii, i have to know if a folder, situated in \\server\images (for example)
exists.

This is the vb code i use:

Private Declare Function NetShareCheck Lib "netapi32.dll" _
                (ByVal ServerName As String, _
                 ByVal Device As String, _
                 ByRef ShareType As Long) As Long

Private Sub Command1_Click()
 Dim SName As String
     Dim SHName As String
     Dim DevType As Long
     Dim Ans As Long

    SName = Text1.Text -->\\server name
    SHName = Text2.Text -->folder to find
    DevType = -1

    Ans = NetShareCheck(StrConv(SName, vbUnicode), StrConv(UCase(SHName),
vbUnicode), DevType)
    MsgBox Ans, , DevType
End Sub

devtype return is 0, i think maybe the server exist, but Ans return
2311...this means: NetShareCheck fails with error 2311
(NERR_DeviceNotShared) when remoted to OS/2.

How can i resolve this?
Thakns a lot



Relevant Pages

  • Re: network path and use of netsharecheck api....
    ... Private Declare Function NetShareCheck Lib "netapi32.dll" _ ... Private Sub Command1_Click ... Dim sharetype As Long ... Dim DevType As Long ...
    (microsoft.public.vb.winapi)
  • Re: Alpha search to load a list box
    ... Dim strTemp As String ... Private Sub LblAlpha_MouseDown(Button As Integer, Shift As Integer, X ... Dim StartX As Long, WidthX As Long ... Private Declare Function apiSelectObject Lib "gdi32" Alias ...
    (microsoft.public.access.formscoding)
  • Re: master volume control in winmm using namespaces
    ... Private Declare Function mixerOpen Lib "WINMM.DLL" (phmx As Long, ... Private Declare Function waveOutSetVolume Lib "WINMM.DLL" (ByVal wDeviceID ... Dim uMixerLine As MIXERLINE ... Private Sub SetWaveVol ...
    (microsoft.public.dotnet.languages.vb)
  • Re: master volume control in winmm using namespaces
    ... Private Declare Function mixerOpen Lib "WINMM.DLL" (phmx As Long, ... Private Declare Function waveOutSetVolume Lib "WINMM.DLL" (ByVal wDeviceID ... Dim uMixerLine As MIXERLINE ... Private Sub SetWaveVol ...
    (microsoft.public.dotnet.languages.vb)
  • ListView.SelectedItem cannot be modified
    ... Dim objFind As LV_FINDINFO ... Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hWnd ... lpClassName As String, ByVal lpWindowName As String) As Long ... 'CompareDates: This is the sorting routine that gets passed to the ...
    (microsoft.public.vb.controls)