home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / sys / next / programm / 5680 < prev    next >
Encoding:
Internet Message Format  |  1992-08-18  |  3.6 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!usc!sdd.hp.com!swrinde!news.dell.com!uudell!pensoft!usenet
  2. From: alex@laos (Alex D. Nghiem)
  3. Newsgroups: comp.sys.next.programmer
  4. Subject: messaging mail in 3.0 with distributed objects -- you can't!
  5. Keywords: distributed objects, mail, 3.0
  6. Message-ID: <1992Aug18.143442.14079@pencom.com>
  7. Date: 18 Aug 92 14:34:42 GMT
  8. Sender: usenet@pencom.com (Usenet Psuedo User)
  9. Reply-To: alex@pencom.com
  10. Organization: Pencom Software
  11. Lines: 101
  12.  
  13. Hello there:
  14.  
  15. Several weeks ago, I posted a message asking for help on how to message mail  
  16. using remote objects.  This is the only concrete response I got (Thanks,  
  17. William!):
  18.  
  19. ================================================================
  20. Begin forwarded message:
  21.  
  22. From: William Shipley <wjs@blorf.cpac.washington.edu>
  23. Date: Tue, 18 Aug 92 01:34:22 -0700
  24. To: Alex D. Nghiem <alex@pencom.com>
  25. Subject: Re: sending remote messages to mail in 3.0
  26.  
  27. Speaker/Listener and Distributed Objects are separate paradigms.  While one  
  28. would hope that everyone using the former would update to the latter, this  
  29. isn't always the case.
  30.  
  31. Specifically, it appears Mail in 3.0 doesn't implement distributed objects.   
  32. Stupid, yes, but then again there's lots to complain about in Mail.
  33.  
  34. So, you're stuck using Speaker/Listener, apparently.
  35.  
  36. -W
  37.  
  38. =============================================================
  39.  
  40. For those that are interested, the following code was posted by Andy Stone  
  41. several weeks earlier:
  42.  
  43. Here's the new, perhaps undocumented, API for Mail:
  44.  
  45. Mail.msg:
  46.  
  47. - openSend;
  48. - setTo:(char *)toField;
  49. - setSubject:(char *)subjectField;
  50. - setCc:(char *) ccField;
  51. - setBody:(char *) bodyField;
  52. - deliver;
  53. -openSend:(int *)sender;
  54. -setTo : (char *) toField inWindow:(int)sender;
  55. -setSubject : (char *) subjectField inWindow:(int)sender;
  56. -setCc : (char *) ccField inWindow:(int)sender;
  57. -setBody : (char *) bodyField inWindow:(int)sender;
  58. -deliver:(int)sender;
  59.  
  60. Note you can now get the id of the newly created window, which will 
  61. prevent the "overwrite of an existing window" bug which everyone was 
  62. alternately blaming Jayson, me, or a dozen others who snarfed that 
  63. undocumented, unpublished hack to send to Mail.
  64. Include Mail.msg in your app, and it will create the MailListener and 
  65. MailSpeaker h and m files.
  66.  
  67. Here's a sample calling for 3.0PR2 or greater:
  68.  
  69. - sendMailTo:(const char *)to subject:(const char *)subject body:(const 
  70. char*)body
  71. {
  72.     port_t mail;
  73.     id speaker;
  74.     int theWin;
  75.   
  76.  
  77.     speaker = [MailSpeaker new];
  78.     mail = NXPortFromName("MailSendDemo", ""); // ACK for now it works
  79.    
  80.     [speaker setSendPort:mail];
  81.     [speaker openSend:&theWin];
  82.     if (subject)[speaker setSubject:(char *)subject inWindow:theWin];
  83.     if (to)[speaker setTo:(char *)to inWindow:theWin];
  84.     if (body)[speaker setBody:(char *)body inWindow:theWin];
  85.     [speaker free];
  86.     return self;
  87. }
  88.  
  89.             andrew
  90.  
  91. --
  92. ||<<-->>||<<==>>||<<++>>||<<??>>||<<++>>||<<-->>||<<==>>||<<++>>||
  93. !!      Andrew Stone            !!        (505) 345-4800        !!
  94. !!    andrew@stone.com          <>       Stone Design Corp      !!
  95. ||<<-->>||<<==>>||<<++>>||<<??>>||<<++>>||<<-->>||<<==>>||<<++>>||
  96.  
  97.  
  98.  
  99. Thanks to both William and Andy for their help.
  100.  
  101.  
  102. Best regards,
  103.  
  104.  
  105. Alex Duong Nghiem          Phone: (512) 343-1111
  106. Pencom Software            Fax:   (512) 343-9650    
  107. 9050 Capital of TX Hwy N.  Mail:  alex@pencom.com
  108. Suite 300                  Mail:  co-Xist_support@pencom.com
  109. Austin, TX 78759           Mail:  co-Xist_info@pencom.com
  110. USA
  111.                            ****************************
  112.                            * NeXTMail gladly accepted *
  113.                            ****************************
  114.