home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / next / programm / 7110 < prev    next >
Encoding:
Text File  |  1992-11-09  |  2.7 KB  |  96 lines

  1. Path: sparky!uunet!noc.near.net!hri.com!spool.mu.edu!uwm.edu!ogicse!cs.uoregon.edu!news.uoregon.edu!news.uoregon.edu!systems
  2. From: jfosback@darmok.uoregon.edu (Jason Fosback)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: HELP: Providing services under 3.0?
  5. Message-ID: <1dn081INNgag@pith.uoregon.edu>
  6. Date: 10 Nov 92 00:37:21 GMT
  7. Organization: University of Oregon Network Services
  8. Lines: 85
  9. NNTP-Posting-Host: darmok.uoregon.edu
  10.  
  11. I'm currently writing an application that will provide a service to  
  12. other applications under NS 3.0.  However, I can't get other  
  13. applications to recognize the fact that my application is indeed  
  14. providing a service.
  15.  
  16. I've tried placing copies in /LocalApps and ~/Apps as per instructions,  
  17. but to no avail.  It doesn't help that the documentation in Librarian  
  18. gives TWO possible link commands for the Makefile.preamble.  I've tried  
  19. *both*.
  20.  
  21. I've tried using different send and return types, but it doesn't seem to  
  22. make a difference.  My ultimate goal is to provide a service that  
  23. doesn't require any information, thus providing the service from any  
  24. application with a service menu.  However, I haven't been able to even  
  25. get an enabled or disabled menu item to appear anywhere.
  26.  
  27. Below is an abridged version of what I have.  I've tried changing the  
  28. main() function to give the commands to theListener (Application  
  29. listener), but it didn't make a difference.
  30.  
  31. I've also tried the dynamic method of installing the services.text  
  32. information in ~/Library/Services in a file called BlahBlah.service, and  
  33. then called NXUpdateDynamicServices().  No luck.  Since I know exactly  
  34. what I want to do, I'd like to avoid this method.
  35.  
  36. Any help will be MUCH appreciated.  Thank you in advance!
  37.  
  38. -jason
  39.  
  40.  
  41. Makefile.preamble
  42.  
  43. #
  44. # Set up the services handler
  45. #
  46.  
  47. LDFLAGS = -sectcreate __ICON __services services.text
  48.  
  49. #LDFLAGS = -segcreate __ICON __services services.text
  50.  
  51.  
  52. services.text:
  53.  
  54. Message: getMail
  55. Port: PopOver
  56. Send Type: NXAsciiPboard
  57. Send Type: NULL
  58. Return Type: NXAsciiPBoard
  59. Return Type: NULL
  60. Menu Item: Retrieve Mail
  61. Key Equivalent: R
  62.  
  63.  
  64. Controller.m (File Owner delegate, connected via IB):
  65.  
  66. - appDidInit:sender
  67. {
  68.     id theListener;
  69.  
  70.     theListener = [NXApp appListener];
  71.     [theListener setServicesDelegate:self];
  72.     return self;
  73.     
  74. }
  75.  
  76. - getMail:(id)pasteboard 
  77.     userData:(const char *)userData 
  78.     error:(char **)msg
  79. {
  80.     [self retrieveMail:self];
  81.     return self;
  82. }
  83.  
  84. - retrieveMail:sender
  85. {
  86.     blah blah; // do stuff
  87.  
  88.     return self;
  89. }
  90.  
  91. ______________________________________________________________________
  92. Jason Fosback, Student Programmer/Consultant| No sir, I didn't like it
  93.        ---- University of Oregon ----       |                 -R&S
  94. Internet:  jfosback@oregon.uoregon.edu      | Star Trek:
  95. NeXT mail: jfosback@darmok.uoregon.edu      |  The NeXT Generation...
  96.