home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / mac / programm / 14557 < prev    next >
Encoding:
Internet Message Format  |  1992-08-26  |  2.4 KB

  1. Path: sparky!uunet!ogicse!cs.uoregon.edu!nntp.uoregon.edu!eric_gorr@coglab_psych.uoregon.edu
  2. From: eric_gorr@coglab_psych.uoregon.edu (Eric Gorr)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: WEIRD BUG:  HELP!  - concerns apple-events
  5. Message-ID: <1992Aug26.190516.26926@nntp.uoregon.edu>
  6. Date: 26 Aug 92 19:05:16 GMT
  7. Article-I.D.: nntp.1992Aug26.190516.26926
  8. Sender: news@nntp.uoregon.edu
  9. Distribution: usa
  10. Organization: University of Oregon Network Services
  11. Lines: 67
  12.  
  13. Think of this code as being two parts, with each part beginning with an
  14. AEGetParamPtr call.  
  15.  
  16. When I run through all of the code in part 1 and then make the
  17. AEGetParamPtr call in part 2, it returns an error -1701.  
  18.  
  19. The code in part 1 works with no difficulties that I can see.
  20.  
  21. Now, when I switch part 1 and part 2 so that part 2 gets executed before
  22. part 1, the AEGetParamPtr in part 1 returns the error -1701.  
  23.  
  24. So, the problem must lie (as near as I can tell) in the strcpy, myBlock,
  25. etc. lines which are esentially the same for both parts.  
  26.  
  27. Any ideas?  I have no clue....
  28.  
  29.  
  30. ..
  31. ..other AEGetParamPtr calls here
  32. ..
  33. ***
  34. ***** PART 1
  35. ***
  36. myErr = AEGetParamPtr( theAppleEvent, texturePathKey, typeChar,
  37. &ignoredType,
  38.                            pathPtr, maxSize, &theSize );
  39.  
  40. ---> potential problem in these lines?
  41.     pathPtr[theSize] = '\0';
  42.     strcpy( thePath, (char*)pathPtr );
  43.     strcat( thePath, (char*)theHead.txName );    
  44.     CtoPstr( thePath );
  45.     myErr = FSMakeFSSpec( 0L, 0L, thePath, &mySpec );
  46.     myBlock->ioCompletion = 0L;
  47.     myBlock->ioNamePtr = 0L;
  48.     myBlock->ioVRefNum = mySpec.vRefNum;
  49.     myBlock->ioWDProcID = 0;
  50.     myBlock->ioWDDirID = mySpec.parID;
  51.     myErr = PBOpenWD( myBlock, false );    
  52.     strcpy( (char*)theHead.textureName.fName, (char*)theHead.txName );
  53.     theHead.textureName.vRefNum = myBlock->ioVRefNum;
  54. ---
  55.  
  56. ***
  57. ***** PART 2
  58. ***
  59.     myErr = AEGetParamPtr( theAppleEvent, ribPathKey, typeChar, &ignoredType,
  60.                            pathPtr, maxSize, &theSize );
  61.  
  62. ---> potential problem in these lines?
  63.     pathPtr[theSize] = '\0';
  64.     strcpy( thePath, (char*)pathPtr );
  65.     strcat( thePath, (char*)"tmp.tmp" );    
  66.     CtoPstr( thePath );
  67.     myErr = FSMakeFSSpec( 0L, 0L, thePath, &mySpec );
  68.     myBlock->ioCompletion = 0L;
  69.     myBlock->ioNamePtr = 0L;
  70.     myBlock->ioVRefNum = mySpec.vRefNum;
  71.     myBlock->ioWDProcID = 0;
  72.     myBlock->ioWDDirID = mySpec.parID;
  73.     myErr = PBOpenWD( myBlock, false );
  74.     strcpy( (char*)theHead.pictureName.fName, (char*)theHead.picName );
  75.     theHead.pictureName.vRefNum = myBlock->ioVRefNum;
  76. ---
  77. ..
  78. .. more code here
  79. ..
  80.