Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

IP address

8 posts in DataWindow Last posting was on 2009-04-17 13:55:23.0Z
Ken Posted on 2009-04-15 04:03:10.0Z
Sender: 3be6.49e55c1f.1804289383@sybase.com
From: Ken
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: IP address
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <49e55c7e.3bf0.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 14 Apr 2009 21:03:10 -0700
X-Trace: forums-1-dub 1239768190 10.22.241.41 (14 Apr 2009 21:03:10 -0700)
X-Original-Trace: 14 Apr 2009 21:03:10 -0700, 10.22.241.41
Lines: 2
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89165
Article PK: 418417

How to get the IP address in PB11.5 ? Please advise.


Jeremy Lakeman Posted on 2009-04-15 05:17:38.0Z
From: Jeremy Lakeman <jeremy.lakeman@gmail.com>
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: IP address
Date: Tue, 14 Apr 2009 22:17:38 -0700 (PDT)
Organization: http://groups.google.com
Lines: 5
Message-ID: <364ebf37-2c63-4c2a-b04f-51d6c3881069@y10g2000prc.googlegroups.com>
References: <49e55c7e.3bf0.1681692777@sybase.com>
NNTP-Posting-Host: 203.122.242.105
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1239772658 6980 127.0.0.1 (15 Apr 2009 05:17:38 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Wed, 15 Apr 2009 05:17:38 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: y10g2000prc.googlegroups.com; posting-host=203.122.242.105; posting-account=euaBtgoAAAC_vDxfsxmpMKlBxHaHpmRS
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.8 (.NET CLR 3.5.30729),gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 fly.essential.com.au:3128 (squid/2.5.STABLE8), 1.0 asp.essential.intranet:3128 (squid/2.5.STABLE8)
Path: forums-1-dub!forums-master!newssvr.sybase.com!news-sj-1.sprintlink.net!news-peer1.sprintlink.net!newsfeed.yul.equant.net!nntp1.roc.gblx.net!nntp.gblx.net!nntp.gblx.net!nlpi057.nbdc.sbc.com!prodigy.net!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!y10g2000prc.googlegroups.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89167
Article PK: 418418


On Apr 15, 1:03 pm, Ken wrote:
> How to get the IP address in PB11.5 ? Please advise.

Using one or more of these win32 functions;
http://msdn.microsoft.com/en-us/library/ms741394(VS.85).aspx


Ken Posted on 2009-04-16 06:56:03.0Z
Sender: 5d12.49e69205.1804289383@sybase.com
From: Ken
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: IP address
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <49e6d683.62d8.1681692777@sybase.com>
References: <364ebf37-2c63-4c2a-b04f-51d6c3881069@y10g2000prc.googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 15 Apr 2009 23:56:03 -0700
X-Trace: forums-1-dub 1239864963 10.22.241.41 (15 Apr 2009 23:56:03 -0700)
X-Original-Trace: 15 Apr 2009 23:56:03 -0700, 10.22.241.41
Lines: 9
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89172
Article PK: 418426

The winsock functions works very well in PB9.0.3. but the
function like gethostname does not work in PB11.5.

> On Apr 15, 1:03 pm, Ken wrote:
> > How to get the IP address in PB11.5 ? Please advise.
>
> Using one or more of these win32 functions;
>

http://msdn.microsoft.com/en-us/library/ms741394(VS.85).aspx


Arthur Hefti Posted on 2009-04-16 09:17:40.0Z
From: "Arthur Hefti" <arthur@catsoft.ch>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <364ebf37-2c63-4c2a-b04f-51d6c3881069@y10g2000prc.googlegroups.com> <49e6d683.62d8.1681692777@sybase.com>
Subject: Re: IP address
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49e6f7b4$1@forums-1-dub>
Date: 16 Apr 2009 02:17:40 -0700
X-Trace: forums-1-dub 1239873460 10.22.241.152 (16 Apr 2009 02:17:40 -0700)
X-Original-Trace: 16 Apr 2009 02:17:40 -0700, vip152.sybase.com
X-Authenticated-User: pb12beta
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89174
Article PK: 418425

Should work, I'm using

function int GetHostName ( ref string HOSTname, int namelen ) Library
"Ws2_32.dll" ALIAS FOR 'gethostname;Ansi'


Arthur

<Ken> wrote in message news:49e6d683.62d8.1681692777@sybase.com...
The winsock functions works very well in PB9.0.3. but the
function like gethostname does not work in PB11.5.

> On Apr 15, 1:03 pm, Ken wrote:
> > How to get the IP address in PB11.5 ? Please advise.
>
> Using one or more of these win32 functions;
>

http://msdn.microsoft.com/en-us/library/ms741394(VS.85).aspx


Ken Posted on 2009-04-17 04:11:42.0Z
Sender: 5d12.49e69205.1804289383@sybase.com
From: Ken
Newsgroups: sybase.public.powerbuilder.datawindow
Subject: Re: IP address
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <49e8017e.1e1.1681692777@sybase.com>
References: <49e6f7b4$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 16 Apr 2009 21:11:42 -0700
X-Trace: forums-1-dub 1239941502 10.22.241.41 (16 Apr 2009 21:11:42 -0700)
X-Original-Trace: 16 Apr 2009 21:11:42 -0700, 10.22.241.41
Lines: 32
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89175
Article PK: 418428

Thanks. GetHostName is working. Please also advise the
function 'gethost'. I am using

function string GetHost(string lpszhost, ref blob
lpszaddress ) library "pbws32.dll"

This function is not working.

> Should work, I'm using
>
> function int GetHostName ( ref string HOSTname, int
> namelen ) Library "Ws2_32.dll" ALIAS FOR 'gethostname
> ;Ansi'
>
>
> Arthur
>
> <Ken> wrote in message
> news:49e6d683.62d8.1681692777@sybase.com... The winsock
> functions works very well in PB9.0.3. but the function
> like gethostname does not work in PB11.5.
>
> > On Apr 15, 1:03 pm, Ken wrote:
> > > How to get the IP address in PB11.5 ? Please advise.
> >
> > Using one or more of these win32 functions;
> >
>
http://msdn.microsoft.com/en-us/library/ms741394(VS.85).aspx
>
>


Arthur Hefti Posted on 2009-04-17 06:28:59.0Z
From: "Arthur Hefti" <arthur@catsoft.ch>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <49e6f7b4$1@forums-1-dub> <49e8017e.1e1.1681692777@sybase.com>
Subject: Re: IP address
Lines: 93
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49e821ab@forums-1-dub>
Date: 16 Apr 2009 23:28:59 -0700
X-Trace: forums-1-dub 1239949739 10.22.241.152 (16 Apr 2009 23:28:59 -0700)
X-Original-Trace: 16 Apr 2009 23:28:59 -0700, vip152.sybase.com
X-Authenticated-User: pb12beta
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89176
Article PK: 418429

Ken
here are some more definitions you can use:

external functions:
function long GetHostByName ( string hostname ) Library "Ws2_32.dll" ALIAS
FOR "gethostbyname;Ansi"
function uint HToNS ( uint hostshort ) Library "Ws2_32.dll" ALIAS FOR
'htons'
function ulong 'inet_addr( string hostip ) Library "Ws2_32.dll" ALIAS FOR
'inet_addr;Ansi'
function int GetHostName ( ref string HOSTname, int namelen ) Library
"Ws2_32.dll" ALIAS FOR 'gethostname;Ansi'
subroutine RtlMoveMemory( ref long dst, long src, long nSize ) Library
"kernel32.dll" Alias For "RtlMoveMemory;Ansi"
subroutine RtlMoveMemory( ref structure dst, long src, long nSize ) Library
"kernel32.dll" Alias For "RtlMoveMemory;Ansi"
subroutine RtlMoveMemory( ref string dst, long src, long nSize ) Library
"kernel32.dll" Alias For "RtlMoveMemory;Ansi"
subroutine RtlMoveMemory( ref byte dst[], long src, long nSize ) Library
"kernel32.dll" Alias For "RtlMoveMemory;Ansi"

How to get the IP:
integer i
long lHost, lIPAddr
hostent hst
byte ipaddr[]
string hostip

lHost = GetHostByName ( host )
RtlMoveMemory( hst, lHost, HOSTENT_LEN )
RtlMoveMemory( lIPAddr, hst.h_addrlist, ADDRLIST_LEN )

FOR i = 1 TO hst.h_length
ipaddr[i] = 0
NEXT
RtlMoveMemory( ipaddr, lIPAddr, hst.h_length )

hostip = ""
FOR i = 1 TO hst.h_length
hostip = hostip + String ( ipaddr[i] )
IF i < hst.h_length THEN
hostip = hostip + '.'
END IF
NEXT

structure:
global type hostent from structure
long h_name
long h_aliases
integer h_addrtype
integer h_length
long h_addrlist
end type


Arthur

<Ken> wrote in message news:49e8017e.1e1.1681692777@sybase.com...
> Thanks. GetHostName is working. Please also advise the
> function 'gethost'. I am using
>
> function string GetHost(string lpszhost, ref blob
> lpszaddress ) library "pbws32.dll"
>
> This function is not working.
>
>
>> Should work, I'm using
>>
>> function int GetHostName ( ref string HOSTname, int
>> namelen ) Library "Ws2_32.dll" ALIAS FOR 'gethostname
>> ;Ansi'
>>
>>
>> Arthur
>>
>> <Ken> wrote in message
>> news:49e6d683.62d8.1681692777@sybase.com... The winsock
>> functions works very well in PB9.0.3. but the function
>> like gethostname does not work in PB11.5.
>>
>> > On Apr 15, 1:03 pm, Ken wrote:
>> > > How to get the IP address in PB11.5 ? Please advise.
>> >
>> > Using one or more of these win32 functions;
>> >
>>
> http://msdn.microsoft.com/en-us/library/ms741394(VS.85).aspx
>>
>>


Roland Smith [TeamSybase] Posted on 2009-04-17 13:55:23.0Z
From: "Roland Smith [TeamSybase]" <rsmith_at_trusthss_dot_com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <49e6f7b4$1@forums-1-dub> <49e8017e.1e1.1681692777@sybase.com> <49e821ab@forums-1-dub>
Subject: Re: IP address
Lines: 7
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49e88a4b@forums-1-dub>
Date: 17 Apr 2009 06:55:23 -0700
X-Trace: forums-1-dub 1239976523 10.22.241.152 (17 Apr 2009 06:55:23 -0700)
X-Original-Trace: 17 Apr 2009 06:55:23 -0700, vip152.sybase.com
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89177
Article PK: 418427

Try the Winsock example on my website:
http://www.topwizprogramming.com/freecode_winsock.html

It has a function to return IP Address. The zipfile has PB8 and PB10
versions. Convert the PB10 version and it should work fine.


John Strano[Sybase] Posted on 2009-04-15 20:02:27.0Z
From: "John Strano[Sybase]" <nichtspamjstrano@csi.com>
Newsgroups: sybase.public.powerbuilder.datawindow
References: <49e55c7e.3bf0.1681692777@sybase.com>
Subject: Re: IP address
Lines: 16
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <49e63d53$1@forums-1-dub>
Date: 15 Apr 2009 13:02:27 -0700
X-Trace: forums-1-dub 1239825747 10.22.241.152 (15 Apr 2009 13:02:27 -0700)
X-Original-Trace: 15 Apr 2009 13:02:27 -0700, vip152.sybase.com
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.datawindow:89169
Article PK: 418423

You may want to consider .NET as well if you're deloying as a .NET target...

http://msdn.microsoft.com/en-us/library/system.net.aspx

http://msdn.microsoft.com/en-us/library/system.net.sockets.aspx

--
John Strano - Sybase Technology Evangelist

blog: http://powerbuilder.johnstrano.com/

<Ken> wrote in message news:49e55c7e.3bf0.1681692777@sybase.com...
> How to get the IP address in PB11.5 ? Please advise.