Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #5172

Re: IP Address function

From "Jamal" <jamal@examples.net>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: IP Address function
Date 2013-04-29 11:09 -0400
Organization Aioe.org NNTP Server
Message-ID <klm2eu$fpc$1@speranza.aioe.org> (permalink)
References <_1xet.160753$ui1.20601@fx02.fr7>

Show all headers | View raw


See:

https://groups.google.com/forum/?fromgroups#!searchin/comp.lang.clipper.visual-objects/get$20IP/comp.lang.clipper.visual-objects/5S1PCH-kMdY/1VJvn7jlJToJ

Jamal

"Martin"  wrote in message news:_1xet.160753$ui1.20601@fx02.fr7...

I am trying to find my PCs IP address from within VO, I found this in
our code and I am trying to test it.

My address is 192.168.2.232 this returns 16.243.24.0

The second debug through a converter gives me 232.2.168.192

Any ideas what is wrong please?

Thanks

Martin

FUNC GetIPAddress1(cHost AS STRING) AS STRING PASCAL
     //  Takes a address string and returns IP string
     LOCAL cRet      AS STRING
     LOCAL pHostEnt  as _WInHostEnt
     LOCAL Tmp1 as DWORD // VO 2.8 PHIL
     LOCAL Tmp2 as DWORD
     LOCAL Tmp3 as _winin_addr
     LOCAL Tmp4 as psz


IF SLen(cHost) > 0
pHostEnt := gethostbyname(String2Psz(cHost))

IF pHostEnt != null_ptr
// VO 2.8 PHIL - changed data types
Tmp1 := DWORD(pHostEnt.h_addr_list)
hit_key(str(tmp1))
         Tmp2 := DWORD(ptr(_cast, Tmp1))
hit_key(str(tmp2))
         Tmp3 := @Tmp2
         Tmp4 := inet_ntoa(Tmp3)

cRet := Psz2String(Tmp4)
ENDIF
ENDIF

RETURN cRet 

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

IP Address function Martin <spam@spam.spam> - 2013-04-26 16:28 +0100
  Re: IP Address function Massimo Bighelli <info@arcasistemi.it> - 2013-04-26 18:07 +0200
    Re: IP Address function Martin <spam@spam.spam> - 2013-04-30 15:15 +0100
  Re: IP Address function dlzc <dlzc1@cox.net> - 2013-04-26 12:12 -0700
  Re: IP Address function "Willie Moore" <williem@wmconsulting.com> - 2013-04-26 14:23 -0500
  Re: IP Address function "Jamal" <jamal@examples.net> - 2013-04-29 11:09 -0400

csiph-web