home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / os2 / programm / 4699 < prev    next >
Encoding:
Internet Message Format  |  1992-09-02  |  2.3 KB

  1. Path: sparky!uunet!wupost!waikato.ac.nz!hamish
  2. From: hamish@waikato.ac.nz
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Re: Accessing tcpipdll from watcom 9.0
  5. Message-ID: <1992Sep3.164055.10572@waikato.ac.nz>
  6. Date: 3 Sep 92 16:40:55 +1200
  7. References: <1992Sep3.163954.10571@waikato.ac.nz>
  8. Organization: University of Waikato, Hamilton, New Zealand
  9. Lines: 40
  10.  
  11. > I am attempting to use the tcp/ip dll from watcom C/386 9.0 under OS/2 2.0, and
  12. > have run into a bit of a problem. After adding the __cdecl __far16 combination
  13. > to the prototypes in the *.h files, I can get such things as sock_init() and
  14. > socket to work and return values, consistant with what they should. However I
  15. > can't get the gethostbyname() function to return a decent valid pointer to a
  16. > bloick of memory (ie the host entry). I have it declared as
  17. > struct hostent * __cdecl __far16 gethostbyname(char hostname[]);
  18. > and am declaring a ptr in the program as
  19. > struct hostent *host;
  20. > and doing 
  21. >  host=gethostbyname("sol.cs.waikato.ac.nz");
  22. > but the program dies trying to access the returned block with access
  23. > violations. (The ptr returned is 0x0a4277bc if that helps). The executable is
  24. > being linked with tcpipdll.lib (From the 1.2.1 programming toolkit).
  25. > I thought the thunking layers were supposed to provide access to 16-bit dll's?
  26. > Or am I doing something wrong? Should I re-create the .lib file using wlib? Or
  27. > should this work with the microsucks .lib file in the kit?
  28. > Or is there something else I am doing wrong?
  29. > TIA.
  30. -- 
  31. ==============================================================================
  32. |  Hamish Marson   <h.marson@waikato.ac.nz>                             OS/2 |
  33. |  Programmer (n/5), School of Computing and Mathematical Sciences           | 
  34. |  University of Waikato,                                                    |
  35. |  Hamilton, New Zealand.                                                    |
  36. |Disclaimer:  Anything said in this message is the personal opinion of the   |
  37. |             finger hitting the keyboard & doesn't represent my employers   |
  38. |             opinion in any way. (ie we probably don't agree)               |
  39. ==============================================================================
  40.   Q. If Nuclear Tests are so safe, why don't the French do them under Paris?
  41.