PRB: OLE Error when Inserting OLE Object in VFP for MacintoshLast reviewed: January 31, 1997Article ID: Q163025 |
The information in this article applies to:
SYMPTOMSWhen inserting an OLE object into a general field, adding an insertable OLE object in a container control on a form, or assigning an object name to the DocumentFile property of an OLE container control in program code, the following error message may appear:
OLE error code 0x80000008: Unspecified error. CAUSEThe object inserted into the general field, or added as an insertable object in an OLE container on a form, or assigned to the DocumentFile property, has File and Creator types that are not associated with an application on the Macintosh.
RESOLUTIONThere are several workarounds to this error:
ARTICLE-ID: Q152370 TITLE : How To Use the APPEND GENERAL Command with an Imager File ARTICLE-ID: Q109482 TITLE : How To Change the Creator and Type Set by FCREATE() STATUSThis behavior is by design.
MORE INFORMATIONOn the Macintosh, all files are associated to an application by either the File or Creator type. A file's Creator and Type attributes identify the parent application of a file and its specific kind. The Type attribute is used by other applications in order to determine whether a file is a valid document to load. Whereas in Windows, files are generally associated to applications by their file extension.
Steps to Reproduce BehaviorThis error message can be produced in the following three methods. Method 1: Attempt to assign a file to the DocumentFile property in code when creating an OLE object using the CREATEOBJECT() function. NOTE: By default, the "Picts folder" and the graphics do not exist. Visual FoxPro ships with sample graphics files that are contained in a self- extracting archive (SEA) file located in the "Microsoft Visual FoxPro:Samples:Graphics" folder. To follow the steps below, double-click the Picts.sea to extract the PICT files. Store them in the default folder specified "Picts Folder." For more information of these SEA files, read the Graphics Readme in the above folder.
* The file and creator types used below are specific to Microsoft Imager
* Uncomment the next three lines of code to prevent OLE error
* mypict= HOME()+"Samples:Graphics:Picts Folder:Fox:Add.PICT"
* SET LIBRARY TO HOME() + "Foxtools.cfm" ADDITIVE
* =FxSetType(SYS(2027,mypict ),"PICT","MIMG")
frmMyForm = CREATEOBJECT('form') && Create a form
frmMyForm.Closable = .F. && Disable the close box
frmMyForm.AddObject('cmdCommand1','cmdMyCmdBtn') && Add Command button
frmMyForm.AddObject("oleObject","oleImager") && Add OLE object
frmMyForm.cmdCommand1.Visible=.T. && Display the "Quit" Command button
frmMyForm.oleObject.Visible=.T. && Display the OLE control
frmMyForm.oleObject.Height = 50 && OLE control height
frmMyForm.oleObject.AutoActivate = 2
frmMyForm.Show && Display the form
frmMyForm.oleObject.DoVerb(0) && 0 for Default, -1 for Edit
READ EVENTS && Start event processing
CLEAR CLASS oleImager
DEFINE CLASS oleImager as OLEControl
OleClass ="MSImager.2" && Server name
* Uncomment next line, comment 2nd DocumentFile to prevent error
* DocumentFile = mypict
DocumentFile = HOME()+"Samples:Graphics:Picts Folder:Fox:Add.PICT"
ENDDEFINE
DEFINE CLASS cmdMyCmdBtn AS CommandButton && Create Command button
Caption = '\<Quit' && Caption on the Command button
Cancel = .T. && Default Cancel Command button (Esc)
Left = 125 && Command button column
Top = 210 && Command button row
Height = 25 && Command button height
PROCEDURE Click
CLEAR EVENTS && Stop event processing, close form
ENDPROC
ENDDEFINE
Method 2:
Attempt to insert an OLE object into an OLE container on a form:
Directly insert the OLE object into the general field of the table.
ARTICLE-ID: Q152370 TITLE : How To Use the APPEND GENERAL Command with an Imager File ARTICLE-ID: Q137295 TITLE : How To Convert Memo Fields into Embedded Word DocumentsNOTE: If error messages are received regarding problems with OLE functionality, please refer to the following articles in the Microsoft Knowledge Base:
ARTICLE-ID: Q151636 TITLE : Insert Object of an Imager File Causes Error or Hangs Mac ARTICLE-ID: Q141099 TITLE : MXL5 Err Msg: "Cannot Start the Source Application"(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Dean Christopher, Microsoft Corporation
|
KBCategory: kbole kbprb
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |