I’m using the VFP (Visual FoxPro) code below to create an instance of the MapWinGIS IMAGE class so that the resulting IMAGE object can be used for a Shape object. The image object is created however, my call to the loImg.Open() method creates an OLE Error “Code 0x80020005 Type Mismatch”.
* Create a MapWinGIS image object based on local image file #DEFINE ImageType_Bitmap_File 0 #DEFINE ImageType_Use_File_Extension 2 #DEFINE ImageType_JPEG_File 4 loImg = CreateObject("MapWinGIS.Image") loImg.Open("s:\mapwingis\car.jpg", ImageType_JPEG_File )
I’ve confirmed that the file exists in the specified path and that the file is in fact a jpg file type.
I’ve also tried using a Bitmap image with ImageType_Bitmap_File and ImageType_Use_File_Extension
Any thoughts on what might be the source of a type mismatch error when I call the Open() method?
FWIW - Another VFP developer on a different machine is seeing the same error.
In my debugger I see a lot of properties inside the Image object. In VFP I can use a FileToStr() function to read the binary contents of the file into a memory variable. Is there a way to stuff the binary value of the jpg image into the object instead of using the Open() method?