home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / os2 / networki / 1217 < prev    next >
Encoding:
Text File  |  1992-09-02  |  2.2 KB  |  51 lines

  1. Path: sparky!uunet!wupost!waikato.ac.nz!hamish
  2. From: hamish@waikato.ac.nz
  3. Newsgroups: comp.os.os2.networking
  4. Subject: Accessing tcpipdll from watcom 9.0
  5. Message-ID: <1992Sep3.163954.10571@waikato.ac.nz>
  6. Date: 3 Sep 92 16:39:54 +1200
  7. Organization: University of Waikato, Hamilton, New Zealand
  8. Lines: 41
  9.  
  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.  
  18. struct hostent * __cdecl __far16 gethostbyname(char hostname[]);
  19.  
  20. and am declaring a ptr in the program as
  21.  
  22. struct hostent *host;
  23.  
  24. and doing 
  25.  
  26.  host=gethostbyname("sol.cs.waikato.ac.nz");
  27.  
  28. but the program dies trying to access the returned block with access
  29. violations. (The ptr returned is 0x0a4277bc if that helps). The executable is
  30. being linked with tcpipdll.lib (From the 1.2.1 programming toolkit).
  31.  
  32. I thought the thunking layers were supposed to provide access to 16-bit dll's?
  33. Or am I doing something wrong? Should I re-create the .lib file using wlib? Or
  34. should this work with the microsucks .lib file in the kit?
  35.  
  36. Or is there something else I am doing wrong?
  37.  
  38. TIA.
  39.  
  40. -- 
  41. ==============================================================================
  42. |  Hamish Marson   <h.marson@waikato.ac.nz>                             OS/2 |
  43. |  Programmer (n/5), School of Computing and Mathematical Sciences           | 
  44. |  University of Waikato,                                                    |
  45. |  Hamilton, New Zealand.                                                    |
  46. |Disclaimer:  Anything said in this message is the personal opinion of the   |
  47. |             finger hitting the keyboard & doesn't represent my employers   |
  48. |             opinion in any way. (ie we probably don't agree)               |
  49. ==============================================================================
  50.   Q. If Nuclear Tests are so safe, why don't the French do them under Paris?
  51.