Re: DNS Lookup
Hi again Thomas,
I just had a bit more of a look at this.
Is this all of your code or do you have some additional initialisation
code that you haven't supplied?
The example I just read says that you must call WSAStartup() first
to use windows sockets
The example was at http://www.xyzt.way.com/inetprog/index.html
It goes one step at a time and might help.
Also, there seem to be a lot of good code in the Euphoria
archive at RDS, in particular the windows sockets project
by Jesus Consuegra and Greg Harris.
Good luck
Mark
PS. The input to your c function should probably be a C_POINTER
rather than C_LONG
ie
gethostbyname =
----- Original Message -----
From: Thomas Parslow (PatRat) <patrat at INAME.COM>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Saturday, April 29, 2000 6:03
Subject: DNS Lookup
> Hi,
> I'm trying to do a DNS lookup using the winsock function GetHostByName, in
> Visual Basic the following works:
>
> Declare Function GetHostByName Lib "wsock32.dll" Alias "gethostbyname"
> (ByVal sHostName As String) As Long
>
> In Euphoria I tried this:
>
> constant WSOCK32 = open_dll("wsock32.dll")
> atom gethostbyname
> gethostbyname = define_c_func(WSOCK32,"gethostbyname",{C_LONG},C_LONG)
> memDNS = allocate_string("www.infoseek.com")
> ? c_func(dllgethostbyname,{memDNS})
> free(memDNS)
>
> But it just returns 0, can any one see what I'm doing wrong here?
> Thomas Parslow (PatRat) ICQ #:26359483
> Rat Software
> http://www.ratsoft.freeserve.co.uk/
>
> Get paid to surf the web!
> http://members.tripod.co.uk/paid2surf/
|
Not Categorized, Please Help
|
|