DOCUMENT:Q163025 05-FEB-2000 [foxpro] TITLE :PRB: OLE Error when Inserting OLE Object in VFP for Macintosh PRODUCT :Microsoft FoxPro PROD/VER:MACINTOSH:3.0b OPER/SYS: KEYWORDS:kbHWMAC kbvfp ====================================================================== ------------------------------------------------------------------------------- The information in this article applies to: - Microsoft Visual FoxPro for Macintosh, version 3.0b ------------------------------------------------------------------------------- SYMPTOMS ======== When 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. CAUSE ===== The 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. RESOLUTION ========== There are several workarounds to this error: - Open the file/graphic in an existing application on the Macintosh, then copy and paste the text/graphic into the general field. - Use a resource editor such as Apple's ResEdit to change the File and Creator type to the types required by the application server. - Use the Foxtools.cfm function FxSetType() to set the File and Creator type of the file to types associated with an application installed on the Macintosh. For more information on using the FxSetType() function with an Imager File, please see the following articles in the Microsoft Knowledge Base: Q152370 How To Use the APPEND GENERAL Command with an Imager File Q109482 How To Change the Creator and Type Set by FCREATE() STATUS ====== This behavior is by design. MORE INFORMATION ================ On 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 Behavior --------------------------- This 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 = '\