Nagaja,
1. If you're going to post code, please post real code. That would be most
helpful for those of us trying to figure out what your program is doing. The
code you posted is not your actual code -- there is no "structure" keyword in C.
2. It also helps to post what's going wrong. What results are you seeing, and
why don't you think they're the right results?
3. It also helps to post any other clues you find. For instance, what's in
"err"? Are you checking it? What's the value of AppNetRefnum? Is it getting
initialized properly? What's sName? Is it a valid pointer?
4. You don't appear to initialize "ent". Is this an error, or an artifact of
your not posting your real code?
5. Not that this is related to any problems you're having, but I'm curing why
you're going through the gyrations with hostent. Why not just access
hret->addrListP? Just curious...
-- Keith
"Nagaja Vasireddy" <[EMAIL PROTECTED]> on 06/26/2000 10:44:56 AM
Please respond to "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent by: "Nagaja Vasireddy" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
cc: (Keith Rollin/US/PALM)
Subject: NetLib Problems
Hi Everybody,
I'm trying to use the NetLibGetHostByName function to get the host info and
cast it to structure hostent. I'm not getting the correct values for
h_addr_list.
Here's the code.
structure hostent** ent;
NetHostInfoBufType hbuf;
NetHostInfoPtr hret;
hret = NetLibGetHostByName(AppNetRefnum, sName, &hbuf, -1, &err);
*ent = (struct hostent*) hret;
(*ent)->h_addr_list = (char**) hret->addrListP;
Can anybody help me figure this out.
thanks
nagaja
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/