home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ogicse!cs.uoregon.edu!nntp.uoregon.edu!eric_gorr@coglab_psych.uoregon.edu
- From: eric_gorr@coglab_psych.uoregon.edu (Eric Gorr)
- Newsgroups: comp.sys.mac.programmer
- Subject: WEIRD BUG: HELP! - concerns apple-events
- Message-ID: <1992Aug26.190516.26926@nntp.uoregon.edu>
- Date: 26 Aug 92 19:05:16 GMT
- Article-I.D.: nntp.1992Aug26.190516.26926
- Sender: news@nntp.uoregon.edu
- Distribution: usa
- Organization: University of Oregon Network Services
- Lines: 67
-
- Think of this code as being two parts, with each part beginning with an
- AEGetParamPtr call.
-
- When I run through all of the code in part 1 and then make the
- AEGetParamPtr call in part 2, it returns an error -1701.
-
- The code in part 1 works with no difficulties that I can see.
-
- Now, when I switch part 1 and part 2 so that part 2 gets executed before
- part 1, the AEGetParamPtr in part 1 returns the error -1701.
-
- So, the problem must lie (as near as I can tell) in the strcpy, myBlock,
- etc. lines which are esentially the same for both parts.
-
- Any ideas? I have no clue....
-
-
- ..
- ..other AEGetParamPtr calls here
- ..
- ***
- ***** PART 1
- ***
- myErr = AEGetParamPtr( theAppleEvent, texturePathKey, typeChar,
- &ignoredType,
- pathPtr, maxSize, &theSize );
-
- ---> potential problem in these lines?
- pathPtr[theSize] = '\0';
- strcpy( thePath, (char*)pathPtr );
- strcat( thePath, (char*)theHead.txName );
- CtoPstr( thePath );
- myErr = FSMakeFSSpec( 0L, 0L, thePath, &mySpec );
- myBlock->ioCompletion = 0L;
- myBlock->ioNamePtr = 0L;
- myBlock->ioVRefNum = mySpec.vRefNum;
- myBlock->ioWDProcID = 0;
- myBlock->ioWDDirID = mySpec.parID;
- myErr = PBOpenWD( myBlock, false );
- strcpy( (char*)theHead.textureName.fName, (char*)theHead.txName );
- theHead.textureName.vRefNum = myBlock->ioVRefNum;
- ---
-
- ***
- ***** PART 2
- ***
- myErr = AEGetParamPtr( theAppleEvent, ribPathKey, typeChar, &ignoredType,
- pathPtr, maxSize, &theSize );
-
- ---> potential problem in these lines?
- pathPtr[theSize] = '\0';
- strcpy( thePath, (char*)pathPtr );
- strcat( thePath, (char*)"tmp.tmp" );
- CtoPstr( thePath );
- myErr = FSMakeFSSpec( 0L, 0L, thePath, &mySpec );
- myBlock->ioCompletion = 0L;
- myBlock->ioNamePtr = 0L;
- myBlock->ioVRefNum = mySpec.vRefNum;
- myBlock->ioWDProcID = 0;
- myBlock->ioWDDirID = mySpec.parID;
- myErr = PBOpenWD( myBlock, false );
- strcpy( (char*)theHead.pictureName.fName, (char*)theHead.picName );
- theHead.pictureName.vRefNum = myBlock->ioVRefNum;
- ---
- ..
- .. more code here
- ..
-