The first is declared "shared"; the second is not. I wonder if that matters -- are
you calling both using someinstance.NetQueryDisplayInformation, or are you calling the
shared one with classname.NetQueryDisplayInformation ?
Good luck.
At 08:57 AM 9/10/2003 +0200, Sean Hederman wrote
>Sorry about posting my previous on an old thread.
>
>Okay, here's my updated problem. Ideally I'd like to use DllImport.
>However, have a look at the following two declares:
><DllImport("Netapi32")> _
>Public Shared Function
>NetQueryDisplayInformation(<MarshalAs(UnmanagedType.LPWStr)> ByVal
>p_sServerName As String, ByVal p_iLevel As Integer, ByVal p_iIndex As
>Integer, ByVal p_iEntriesRequested As Integer, ByVal
>p_iPreferredMaximumLength As Integer, ByRef p_iReturnedEntryCount As
>Integer, ByRef p_iBuffer As Integer) As Integer
>
>End Function
>
>Private Declare Function NetQueryDisplayInformation Lib "netapi32" Alias
>"NetQueryDisplayInformation" (<MarshalAs(UnmanagedType.LPWStr)> ByVal
>p_sServerName As String, ByVal p_iLevel As Integer, ByVal p_iIndex As
>Integer, ByVal p_iEntriesRequested As Integer, ByVal
>p_iPreferredMaximumLength As Integer, ByRef p_iReturnedEntryCount As
>Integer, ByRef p_iBuffer As Integer) As Integer
>
>As far as I can see they should produce the exact same results. In
>reality they only do if I pass in Nothing into ServerName. If I pass
>\\DOMAINCONTROLLER for example, the DllImport returns a Server Not
>Available error, whereas when I call the Declared function it returns
>More Data, which is correct. Why are these two returning different
>results? As far as I can see they are identical.
>[snip]
J. Merrill / Analytical Software Corp
===================================
This list is hosted by DevelopMentor� http://www.develop.com
NEW! ASP.NET courses you may be interested in:
2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet
Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet
View archives and manage your subscription(s) at http://discuss.develop.com