CANT FIND DLL POINT NETREMOTE TOD NETAP132.DLL

MARIOZNETO 24/09/2004 08:24:31
#43300
usei o exemplo abaixo mas Deu o seguinte erro:

CANT FIND DLL entry POINT NETREMOTE TOD NETAP132.DLL

usei este exemplo para buscar data e hora de um pc da rede!

'executei este parametro
data = ServerTime("servidorsmc")

Public Declare Function NetRemoteTOD Lib "Netapi32.dll" (yServer As Any, pBuffer As Long) As Long
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)
Public Declare Function NetApiBufferFree Lib "Netapi32.dll" (ByVal lpBuffer As Long) As Long

Private Type TIME_OF_DAY
t_elapsedt As Long
t_msecs As Long
t_hours As Long
t_mins As Long
t_secs As Long
t_hunds As Long
t_timezone As Long
t_tinterval As Long
t_day As Long
t_month As Long
t_year As Long
t_weekday As Long
End Type

Public Function ServerTime(ByVal pServerName As String) As Variant
Dim t As TIME_OF_DAY
Dim tPtr As Long
Dim Result As Long
Dim szServer As String
Dim ServDate As Date

If Left(pServerName, 2) = "\\" Then
szServer = StrConv(pServerName, vbUnicode)
Else
szServer = StrConv("\\" & pServerName, vbUnicode)
End If

Result = NetRemoteTOD(szServer, tPtr)

If Result = 0 Then
Call CopyMemory(t, ByVal tPtr, Len(t))
ServDate = DateSerial(70, 1, 1) + (t.t_elapsedt / 60 / 60 / 24)
ServDate = ServDate - (t.t_timezone / 60 / 24)
NetApiBufferFree (tPtr)
ServerTime = ServDate
Else
'erro
End If
End Function

USUARIO.EXCLUIDOS 24/09/2004 10:37:46
#43333
Resposta escolhida
nao sei de onde vc tirou o exemplo - entao nao sei o quanto ele é válido...
mas partindo do princípio que o código está correto, a versão da api que você tem NETAPI32.DLL não está compatível com a do código...
talvez seja interessante conversar com o dono do código a respeito da versão utilizada e tentar encontrar isso...
Tópico encerrado , respostas não são mais permitidas