BUG: Cannot Use LoadPicture() with Images Included in Project (200294)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
- Microsoft Visual FoxPro for Windows 6.0
This article was previously published under Q200294 SYMPTOMS
When you call the LoadPicture function from within a Visual FoxPro .app or .exe program, and you use a file name that is the same as one that is included in the project, you may receive the following OLE error:
OLE error code 0x800a01e1: Unknown COM status code.
CAUSE
Visual FoxPro first looks at the files that are included in the project, and then calls application programming interfaces (APIs) that do not handle embedded files.
RESOLUTION
Change file names so that the LoadPicture function is not called with names that are included in the project. You can do this manually by using different names for your files, or programmatically at run time by using code like the following:
LOCAL lcOldFile, lcNewFile
lcOldFile = "D:\graphics\picture1.bmp"
lcNewFile = JUSTPATH(lcOldFile) + SYS(3) + ".bmp"
RENAME (lcOldFile) TO (lcNewFile)
x = LOADPICTURE(lcNewFile)
RENAME (lcNewFile) TO (lcOldFile)
NOTE: The JUSTPATH function was introduced in Visual FoxPro 6.0.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. REFERENCES
(c) Microsoft Corporation 2000, All Rights Reserved. Contributions by Brian Shreves, Microsoft Corporation.
Modification Type: | Major | Last Reviewed: | 8/27/2002 |
---|
Keywords: | kbbug kbDSupport kbProjManager kbXBase KB200294 kbAudDeveloper |
---|
|