Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Image file remains open after creating it with DLL
Message
De
28/09/2004 12:58:04
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Titre:
Image file remains open after creating it with DLL
Divers
Thread ID:
00946791
Message ID:
00946791
Vues:
58
I am working on a 2D Barcode feature in a vertical market application, written in VFP8 SP1 and running on WinXP Pro (not SP2). I am trying to implement in my application the 2d barcode library "DLLPDF417.DLL" (v1.5, 2004) by Wolf Software of Germany. According to documentation in the trial download at their website(www.barcode24.com), the DLL was compiled in Vis C++. This DLL, when sent a data string, will create a 2D barcode in either BMP image or Windows Metafile (WMF) format. I e-mailed the company directly last week, describing the problem I am experiencing, but have so far received no reply.

I am trying to replace our old DLL that has a dependency on MS Paint being installed and registered as the default program to use with BMPs. Since it comes with Windows, this should not be a problem. Trouble is our user's, the U.S. Military, sometimes have re-registered the program default for the Windows BMP file type to other programs or have somehow misplaced MS Paint on their HD.

When using the new DLL, I send a data string to it's Save function: WSPSave(cDataStr,cOutPath,nDPI,lType). This creates a barcode image file on disk, in bitmap format, just fine. The resulting BMP file can be stored as a fullpath in a memo field and then called from the "Picture From File" setting on the VFP report form. By referencing the report table's memo field, the image is located on disk and puts the bar code image on the report with no problem printing. So far, so good.

The problem is that the created BMP file cannot then be deleted after printing because VFP thinks the file is still open. For that matter, so does any other Windows image editor that I have tried to view the BMP file with while the EXE is still running. Once I close the current EXE session, I can delete the file by whatever means, i.e. Vfp's DELETE FILE, Delete in Windows Explorer, etc.

I found that, at least in a VFP environment, this DLL does not close the file it has created but also does not expose a file handle or a FileClose function for the programmer to use. I've tried using a variety of schemes and manipulations involving the VFP low-level file functions and the WIN API file functions but so far, no joy.

Does anyone have other ideas to resolve this? I don't expect that many have used this DLL before but I thought someone might know how to delete a file with an unknown handle, during a current EXE session. Deleting the image files when starting up the next session works fine but is not a 'clean' coding technique (in my opinion an app should clean up after itself, not on startup before it runs again) and it's not the way my boss wants it either <g>. Any advice or suggestions will be appreciated.

Thanks,
Mark Rietman
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform