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

  1. Path: sparky!uunet!sun-barr!ames!uakari.primate.wisc.edu!usenet.coe.montana.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: Code not converting vRefNum & DirID to just vRefNum correctly
  5. Message-ID: <1992Aug28.191236.10477@nntp.uoregon.edu>
  6. Date: 28 Aug 92 19:12:36 GMT
  7. Sender: news@nntp.uoregon.edu
  8. Distribution: usa
  9. Organization: University of Oregon Network Services
  10. Lines: 37
  11.  
  12.  
  13. Everything appears to work properly up to and including the FSMakeFSSpec
  14. call.
  15.  
  16. I am certain that myPictSpec.vRefNum and myPictSpec.parID contain the
  17. correct values.
  18.  
  19. What I think is happening is that I am not initializing myPictBlock
  20. correctly.
  21.  
  22. The value in myPictBlock->ioVRefNum after the PBOpenWB call is -32xxx and
  23. when I use this number to specify a directory, it chooses the System Folder
  24. on my start up disk - this is incorrect.
  25.  
  26. Any ideas?  I am sure that it is something fairly obvious...
  27.  
  28. I am using THINK C 5.0.
  29.  
  30.  
  31. thanx...
  32.  
  33.     myErr = AEGetParamPtr( theAppleEvent, ribPathKey, typeChar, &ignoredType,
  34.                            pathPtr, maxSize, &theSize );
  35.     pathPtr[theSize] = '\0';
  36.     strcpy( thePath, (char*)pathPtr );
  37.     strcat( thePath, (char*)"tmp.tmp" );    
  38.     CtoPstr( thePath );
  39.     myErr = FSMakeFSSpec( 0L, 0L, thePath, &myPictSpec );    
  40.     myPictBlock->ioCompletion = 0L;
  41.     myPictBlock->ioNamePtr = 0L;
  42.     myPictBlock->ioVRefNum = myPictSpec.vRefNum;
  43.     myPictBlock->ioWDProcID = 0;
  44.     myPictBlock->ioWDDirID = myPictSpec.parID;
  45.     myErr = PBOpenWD( myPictBlock, false );
  46.     strcpy( (char*)theHead.pictureName.fName, (char*)theHead.picName );
  47.     theHead.pictureName.vRefNum = myPictBlock->ioVRefNum;
  48.     myErr = PBCloseWD( myPictBlock, false );
  49.