home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / next / programm / 6016 < prev    next >
Encoding:
Text File  |  1992-09-08  |  1.6 KB  |  45 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!rpi!ghost.dsi.unimi.it!itnsg1.cineca.it!ronchet
  3. From: ronchet@itnsg1.cineca.it (Marco Ronchetti)
  4. Subject: performRemoteMethod does not work. What's wrong?
  5. Message-ID: <1992Sep6.120827.22094@itnsg1.cineca.it>
  6. Keywords: performRemoteMethod speaker
  7. Organization: Laboratorio di Fisica Computazionale, INFM. Trento Italia
  8. Date: Sun, 6 Sep 1992 12:08:27 GMT
  9. Lines: 34
  10.  
  11. I'm trying to pass commands to WriteNow. The ultimate goal is to build a file of addresses and infos with a Database, and then merge the info in a wn document.
  12. I'd like to do it from my program, without requiring the user to actually 
  13. using WriteNow and giving the merge command.
  14.  
  15. As a first step, I try opening a file with WriteNow (easy, it works). Then
  16. I try passing a simple method with performRemoteMethod. I tried something
  17. like "quit", "hide", "selectAll". (I verified that those methods do exist by
  18. using NibEditor on WriteNow). Well, nothing happens, although I get a return
  19. code = 0, which should mean that everything was fine...
  20.  
  21. What do I do wrong? 
  22.  
  23. Thanks
  24.     Marco Ronchetti
  25.     
  26. ===== here is my code:
  27.  
  28. - doIt:sender
  29. {
  30.     port_t thePort;
  31.     int result, flag;    
  32.     id targetApp;
  33.     
  34.     thePort = NXPortFromName("WriteNow",NULL);
  35.     targetApp = [NXApp appSpeaker];
  36.     [targetApp setSendPort:thePort];
  37.     result = [targetApp sendOpenFileMsg:"/users/ronchet/Speaker/wd.wn"
  38.               ok:&flag andDeactivateSelf:NO];
  39.     printf("open : %d %d\n", result, flag);
  40.     result = [targetApp performRemoteMethod:"quit"];
  41.     printf("quit : %d\n", result);
  42.     return self;
  43. }
  44.  
  45.