Re: Object variable not set
try:
VB Code:
Set ip = inet_ntoa(addr.sin_addr)
Re: Object variable not set
When doing this:
VB Code:
Dim ip As String
Set [b]ip =[/b] inet_ntoa(Addr.sin_addr)
The error is on the bold line saying "Object required".
When I do this:
VB Code:
Dim ip As Object
Set ip = [b]inet_ntoa[/b](addr.sin_addr)
It errors on the bold line saying "Type mismatch". :confused:
Re: Object variable not set
Well what does inet_ntoa() return?
You would just have to define "ip" as what ever it returns.
Type Mismatch in that case means your using the wrong type of variable to store the returned data the function gives to you.
Re: Object variable not set
inet_ntoa() returns a Long
VB Code:
Dim ip As Long
Set [b]ip[/b] = inet_ntoa(Addr.sin_addr)
Error "Object required". It goes back and forth everytime I changed something.
EDIT: saw you edited your post. how do you think this can be fixed?
Re: Object variable not set
VB Code:
Public Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (Destination As Any, Source _
As Any, ByVal length As Long)
Public Declare Function lstrlen Lib "kernel32.dll" Alias "lstrlenA" (ByVal lpString As Any) As Long
Dim ip as Long
Dim ipString as string
ip = inet_ntoa(Addr.sin_addr)
' Copy the result into a string variable.
ipString = Space(lstrlen(ip))