home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / mac / programm / 14746 < prev    next >
Encoding:
Text File  |  1992-08-30  |  2.2 KB  |  74 lines

  1. Path: sparky!uunet!pageworks.com!world!eff!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!ames!data.nas.nasa.gov!taligent!apple!mumbo.apple.com!gallant.apple.com!wintermute.apple.com!user
  2. From: ksand@apple.com (Kent Sandvik)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: CFront error "cannot make a ..."
  5. Message-ID: <ksand-290892201634@wintermute.apple.com>
  6. Date: 30 Aug 92 03:25:24 GMT
  7. References: <71806@apple.Apple.COM>
  8. Sender: news@gallant.apple.com
  9. Followup-To: comp.sys.mac.programmer
  10. Organization: Apple
  11. Lines: 61
  12.  
  13. In article <71806@apple.Apple.COM>, jwo@Apple.COM (Jamie Osborne) wrote:
  14. > I am using MacApp 3.0.1 w/ MPW 3.2 and C++ 3.2.  I am trying to do a relatively simple thing- use the PPCBrowser call.
  15. > Here's what I do:
  16. > OSErr    CAEProcessor::PPCBrowseConnect()
  17. > {
  18. >     PortInfoRec thePortInfo;
  19. >     TargetID     theTarget;
  20. >     
  21. >     AEAddressDesc theAddress;
  22. >     Str255        theAddressee;
  23. >     
  24. >     if ((PPCBrowser ((ConstStr255Param) nil,(ConstStr255Param) nil,FALSE,
  25. >         &theTarget.location,&thePortInfo,
  26. >             (PPCFilterProcPtr) nil,(ConstStr32Param) nil)) != noErr)
  27. >         return false;
  28. >
  29. Funny, I just answered this on AppleLink, most likely you are looking
  30. at the CIncludes PPCBrowser function prototypes, when you should look
  31. at the MacApp specified C interfaces (that have C++ call by references
  32. instead of pointers).
  33.  
  34. Here's a snippet that compiles/works (from AEGestalt, on Developer CDs):
  35.  
  36. /    Do a PPC Browser lookup of existing nodes that talk the same protocol,
  37. //    i.e. an open application with the same signature
  38. #pragma segment ADoCommand
  39. pascal void TLookupCommand::DoIt()
  40. {
  41.     FailInfo fi;
  42.     TargetID theTargetID;
  43.     PortInfoRec thePortInfo;
  44.     AEAddressDesc targetAddress;
  45.     CStr255 thePrompt = "Find node you want to examine";
  46.     CStr255 theType = "AEGestalt Nodes";
  47.     CStr255 windowTitle;
  48.  
  49.     if (fi.Try())
  50.     {
  51.         FailOSErr(PPCBrowser(thePrompt, theType, FALSE, theTargetID.location,
  52. thePortInfo, MyPPCBrowserFilter, "")); // !!!note, not address, instead VAR
  53.         fi.Success();
  54.     }
  55.     else
  56.     {
  57.         fDocument->fOKNode = FALSE;
  58.         if (fi.error == userCanceledErr)
  59.             return;
  60.         else
  61.             fi.ReSignal();
  62.     }
  63.  
  64. ...
  65.  
  66. Cheers,
  67. Kent Sandvik
  68. ... Saturday evening, time to go home from the office...
  69.  
  70. ---
  71. Warning, Bimbo eruptions most likely to happen in California this weekend.
  72.