>Thank you Luis. Unfortunately, this is VFP 8 and I can't use an expression as a control source for the object (unless, of course, I've missed something in the control?????).
>
>.........Rich
>
>>>We need to print a 2D Barcode in a label. We are using a 3rd party package (foxbarcodeqr) which takes the string you pass it and creates a JPG (PNG/BMP also available) file. This part is working properly.
>>>
>>>The code in my "Print" button is.....
>>>SET STEP ON
>>>loFbc = NEWOBJECT("FoxBarcodeQR","progs\foxbarcodeqr.prg")
>>>SCAN
>>>**** Set the data for the bar-code field
>>> lcBarCodeString = TRANSFORM(recv_lbl.recv_qty )
>>> lcBarCodeString = lcBarCodeString + ";Record "+TRANSFORM(RECNO())
>>> lcBarCodeString = lcBarCodeString + ";"+TRIM(crsselection.supname)
>>> lcBarCodeString = lcBarCodeString + ";"+TRIM(recv_lbl.rev)
>>> lcBarCodeString = lcBarCodeString + ";"+TRIM(recv_lbl.desc1+desc2)
>>> lcBarCodeString = lcBarCodeString + ";"+TRIM(recv_lbl.date_code)
>>> lcBarCodeString = lcBarCodeString + ";"+dtoc(date())
>>> lcBarCodeString = lcBarCodeString + ";"+TRIM(crsselection.uniq_key)
>>> lcBarCodeString = lcBarCodeString + ";"+TRIM(recv_lbl.pno)
>>>
>>>**** Create the bar_code image
>>> lcQRImage = loFbc.QRBarcodeImage(lcbarcodestring,,2,1)
>>>
>>>**** Copy to the "Picture" file
>>> COPY FILE (lcQRImage) TO ("c:\tempdl\2d_bar_code.jpg")
>>>
>>> DELETE FILE (lcQRImage)
>>>
>>> Label Form [Reports\2d_POQUERY] NEXT 1 To PRINTER NOCONSOLE
>>>
>>> DELETE FILE ("c:\tempdl\2d_bar_code.jpg")
>>>ENDSCAN
>>>
>>>The Label Form has a Picture/Active X Bound Control which is set to Print Picture From a file. The filename property is set to "c:\tempdl\2d_bar_code.jpg"
>>>
>>>The problem is that the same bar code is printing on all the labels. I've stepped through the code and verified that this file gets deleted and re-created as expected. I've manually changed the "bar-code picture" to a real picture image before issuing the next LABEL FORM command, but I still get the original image.
>>>
>>>I've tried SYS(1104) in the hope that would clear wherever the picture is being cached, but without success.
>>>
>>>All suggestions welcome.
>>>
>>>........Rich
>>
>>With FoxBarcodeQR not need to copy and delete the image file generated.
>>
>>In the Image control's Label, you must call the method QRBarcodeImage() as shown in the image in
http://i3.codeplex.com/download?ProjectName=VFPX&DownloadId=625345 or the attachment file.
>>
>>In this way, each image file has a unique name generated and saved in a folder in the Windows temporary files, automatically eliminating in the Destroy event of the QRBarcode class.
>>
>>See the brief documentation:
http://vfpx.codeplex.com/wikipage?title=FoxBarcodeQRFoxBarcode and FoxBarcodeQR are compatible with VFP 6.0 and above.
Luis María Guayán
Tucumán, Argentina
________________________________
SysOp de
www.PortalFox.comNada corre como un zorro
________________________________