Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!kth.se!cyklop.nada.kth.se!news From: mattiasb@dront.nada.kth.se (Mattias Berglund) Newsgroups: comp.sys.mac.programmer Subject: Re: SUMMARY: Trying to use MacTCP with THINK LSC 3.02 - no solution yet. Keywords: mactcp think C Message-ID: <1991Jan9.140919.2757@nada.kth.se> Date: 9 Jan 91 14:09:19 GMT References: <1991Jan09.042652.28018@comp.vuw.ac.nz> Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 52 I have written an application which makes use of MacTCP, and never had the problems you described. (Other problems, yes, but not these :-)). A few suggestions: * Don't use strcpy to copy pascalstrings as they are not null-terminated. If you must use PBOpen, try "paramBlock.ioNamePtr = (StringPtr) "\p.TCP";" * Do use OpenDriver, I use the following in my code: #define TCPDRIVER "\p.IPP" static short gRefNum; OSErr OpenMacTCP(void) { OSErr err; err = OpenDriver(TCPDRIVER, &gRefNum); return(err); } I hope this helps you. If you get by this problem I can give a few hints about upcoming problems, the ones I stumbled on - more specifically in the DNR package: * The routine OpenOurRF has a bug: if the application sits on a volume different from the boot volume, the OpenResource-call will fail with a resNotFound. Bracket that call, or even the while loop, with GetVol/SetVol; or maybe use OpenRFPerm. * In the include file "AddressXlation.h" the struct hostInfo misses a vital field: typedef struct hostInfo { int rtnCode; char cname[255]; short numAddrs; /*** Ooops, someone missed this one... ***/ unsigned long addr[NUM_ALT_ADDRS]; }; I don't know if these errors are found i the Pascal interfaces also. Mattias Berglund JOB Systemintegration AB P.O. BOX 34072 S-100 26 STOCKHOLM SWEDEN