Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!uwm.edu!linac!mp.cs.niu.edu!ux1.cso.uiuc.edu!resnick From: resnick@cogsci.uiuc.edu (Pete Resnick) Newsgroups: comp.sys.mac.programmer Subject: Re: Using MacTCP from Think C Qs Message-ID: <1991Apr3.215219.28627@ux1.cso.uiuc.edu> Date: 3 Apr 91 21:52:19 GMT References: <1991Apr3.212555.20476@bronze.ucs.indiana.edu> Sender: usenet@ux1.cso.uiuc.edu (News) Organization: University of Illinois at Urbana Lines: 53 cmcclary@bronze.ucs.indiana.edu (Charles McClary) writes: >Anybody have any suggestions, comments, and/or warnings for using MacTCP >calls from Think C. So far, when I make the call to OpenResolver, it >returns -1. The File DNR.c is included in the project. Change the OpenRFPerm to OpenResolver. For some reason, that solves the problem. I don't know why. Here is what to do to the MacTCP header files that are provided: In MacTCPCommonTypes.h, change the "ifndef/include" definition to look like this: #ifndef _MacTypes_ #include #endif /* _MacTypes_ */ In UDPPB.h, comment out the word "pascal" in the declaration of UDPNotifyProc so that it looks like this (THINK C doesn't like a typedefed pascal funtion): typedef /*pascal*/ void (*UDPNotifyProc) ( StreamPtr udpStream, unsigned short eventCode, Ptr userDataPtr, struct ICMPReport *icmpMsg); Do the same thing in TCPPB.h for TCPNotifyProc: typedef /*pascal*/ void (*TCPNotifyProc) ( StreamPtr tcpStream, unsigned short eventCode, Ptr userDataPtr, unsigned short terminReason, struct ICMPReport *icmpMsg); You will not be able to use these typedefs in your own programs; they are only to deal with other declarations in your header files. In your code, declare your notify procs as 'pascal void whatever' with all of the parameters as they are declare in the typedef. That's all I have found so far, except that in my copy of TCPPB.h, instead of the csCode for receive buffer return being TCPBfrReturn as documented, it was TCPRcvBfrReturn. I changed it to TCPBfrReturn. pr -- Pete Resnick (...so what is a mojo, and why would one be rising?) Graduate assistant - Philosophy Department, Gregory Hall, UIUC System manager - Cognitive Science Group, Beckman Institute, UIUC Internet/ARPAnet/EDUnet : resnick@cogsci.uiuc.edu BITNET (if no other way) : FREE0285@UIUCVMD