Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Append General (Bitmap) causes NDVTM error under Win7
Message
De
05/12/2012 16:19:41
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Versions des environnements
Visual FoxPro:
FoxPro Windows
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01494076
Message ID:
01558854
Vues:
54
>>>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.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform