robert@polari.UUCP (robert) (08/20/89)
> This is a first try at a appletalk program to find servers on a net > It is crude at best, and entirely nonfunctional. I need your help in > finding out why this won't work. it was compiled using lightspeed C. > Any and all advice would be appreciated. I was able to get your code to run (at least, "Matches Gotten" came out as nonzero) under Lightspeed C, version 4.0. Here's what you need to do: In procedure SetupMPP, delete the following lines: myMPPParamBlockPtr->MPP.DDP.listener = NIL; myMPPParamBlockPtr->MPP.LAP.LAP1.handler = NIL; myMPPParamBlockPtr->MPP.LAP.LAP1.wdsPointer = NIL; The MPPParamBlock Record type is a variant record. The fields listed above are not used for the PLookupName call. Look at the definition of MPPParamBlock on page 511 of Inside Mac, volume 5. For example, the MPP.DDP.listener field is ONLY used when you call the procedures OpenSkt, CloseSkt, and WriteDDP. The name MPP.DDP.listener just points to a certain byte of the MPPParamBlock Record. When you set MPP.DDP.listener to NIL, I think you overwrote other bytes that ARE used for the PLookUpName call. So you wound up passing bad parameters to PLookUpName. My the way, this code probably won't work with version 2.15 (or earlier) of Lightspeed C. Symmantec messed up the glue code for the "preferred" interface calls in version 2.15. They CLAIM that they fixed this in version 3.0 and later. I have version 4.0, and the preferred calls I have tried did work. Robert Riebman D&R Information Engineering P.O.Box 3156 Redmond, WA 98073