CANT FIND DLL POINT NETREMOTE TOD NETAP132.DLL
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
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
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...
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