BUG: GetPicture "Invalid Function Call" after CHAIN (78387)
The information in this article applies to:
- Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0
- Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0a
- Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0b
This article was previously published under Q78387 SYMPTOMS
Attempting to CHAIN to a program that uses the GetPicture toolbox
routine (an MBLC stored in QuickBasic for Macintosh) will result in an
"Invalid function call" (error 5) under the following conditions:
- The program is run in the QuickBasic interpreter.
- The program being chained from does not contain the PICT
resource needed by GetPicture.
This problem occurs because the program being chained to attempts to
use the resource fork of the original program (the program chained
from) that was run. If the resource fork of the original program does
not contain a PICT resource, then a call to the GetPicture toolbox
routine will fail with an "Invalid function call" error.
This problem does not occur in a compiled program. In a compiled
program, the resource fork of the program being chained from is closed
and the resource fork of the program being chained to is used.
WORKAROUND
You can work around the problem by copying the PICT resource (needed
by GetPicture) to the chained-from program, as follows:
- Launch ResEdit.
- From the files/folders list box, click on the folder containing
ToolBoxSampler. Repeat this step as many times as necessary
until the ToolBoxSampler is found.
- From the files/folders list box, select ToolBoxSampler. A list
box containing the resources associated with ToolBoxSampler will
appear.
- From the resource list box, click on PICT.
- From the Edit menu, choose Copy.
- Close the resource list box.
- From the file/folders list boxes remaining on the screen, close as
many of the list boxes as necessary such that the program "chainer"
created in step 4 above can be found.
- Click on chainer. A list box containing the resources associated
with the program chainer will appear.
- From the Edit menu, choose Paste. PICT will be added to the list of
resources.
- From the File menu, choose Quit.
- From the "Save 'chainer' before closing?" dialog box, select Yes.
- Follow steps 1 through 9 further above.
After being chained to, the ToolBoxSampler should run without error.
Modification Type: | Major | Last Reviewed: | 10/23/2003 |
---|
Keywords: | kbbug KB78387 |
---|
|