Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Append General (Bitmap) causes NDVTM error under Win7
Message
 
 
To
05/12/2012 16:19:41
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Environment versions
Visual FoxPro:
FoxPro Windows
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01494076
Message ID:
01558858
Views:
46
>>>>I am most definitely NOT using General fields in anything new. :-)
>>>>
>>>>The General field is only used in temporary cursors used to print reports. I don't use them anywhere in the system other than as a means of easily including images in reports. I agree that they're a bad idea, but it was the only way to create reports that would include a photo at the time.
>>>
>>>Was it 1999? At the time I've seen the same technique applied in VFP5 apps.
>>>
>>>I really don't know if it's a viable way today. It's a case of software rot - it relies on some mechanisms in the OS which may have changed meanwhile. It pre-dates COM automation (because it's not even proper automation, it's wrapped and you have no control, no object to play with), and even COM is out of favor nowadays (though I don't see it going away ever, it's too widespread).
>>>
>>>General fields had a very limited usability back then, and were a dead end. I don't see your problem being fixed with general fields at all. You'll need something else. BTW, are you running it with 2.6 runtimes or within VFP? The latter is quite an option, not that hard to do at all. I once wrote a wrapper form in which to run a FPD app during a lunch break.
>>
>>We're using SQL Server and the image is stored in the Image field. The printing is done using Ole Bound Control which uses name of the General Field option. When I try to preview the report I am getting the 'Ole Object is Invalid or Corrupted' error. It seems to be the same error for BMP or JPG.
>>
>>My question is (given the fact that the images are stored in the image field in SQL Server and can be retrieved as General or as Blob fields depending on the mapbinary setting), what is the correct way to print them?
>>
>>I've checked this Report and it seems to be broken in all prior versions. Perhaps the problem is only occurring in Windows 7 and beyond as I suppose it used to work before.
>
>This seems to be the key: "stored in the Image field". It means it's just a filetostr() of an actual file. A general field is basically a wrapper around an actual file. This wrapper includes some information about where in this field the actual file begins, how long is it, and what type is it - whatever the actual instance of an OLE server needs to open it, plus the mandatory bmp preview of the file. Someone once posted a way to extract the actual file from a general field. But you already have the file in your image field.
>
>But since your image fields already contain the actual file, your best bet is to dump them into temp files via strtofile() (giving them appropriate extensions, if needed), and keep the fullpaths of the filenames in the cursor off which you run the report, and change the option to "file name". Kill the temp files when done.

This also sounds a big complex. Suppose I retrieve a cursor with 365 rows with 4 columns of pictures and 4 columns that contain just the filename (not the path) of the pictures. The image field does indeed have filetostr of the file.

So, what is the correct way for me to print all the pictures from that cursor (I can retrieve that image field as a Blob or as a General field).
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform