Hello,
I'm trying to save files with different names within a loop in C++, I've found a number of solutions, but unfortunately it doesn't fit my work.
My function saves a QRcode as an image (.jpg). the syntax of the statement which does the saving is as follows:
ERRCODE _stdcall BCSaveImageA ( t_BarCode * pBarCode,
LPCSTR lpszFileName,
e_IMType eImageType,
LONG lXSize,
LONG lYSize,
DOUBLE dXRes,
DOUBLE dYRes
)
where:
Parameters:
[in] pBarCode Pointer to barcode structure.
[in] lpszFileName Filename
[in] eImageType Enumeration for the type of the image.
[in] lXSize X-Size of the image [pixel]. For Vector-EPS the unit is [0.001 mms]
[in] lYSize Y-Size of the image [pixel]. For Vector-EPS the unit is [0.001 mms]
[in] dXRes X-Resolution of the image [pixels / inch].
[in] dYRes Y-Resolution of the image [pixels / inch].
which is used successfully to generate a single file in my program as follows:
eCode = BCSaveImageA(pBC,"C://webcontent/QR12.jpg", 4, LBarcodeWidth,LBarcodeHieght, dpi, dpi);
The problem is how can I save a number of image files (.jpg) with different names? I've used a for loop and tried to write the name of the new file in the above statement as follows:
eCode = BCSaveImageA(pBC,"C://webcontent/QR"+IntToStr(i)+".jpg", 4, LBarcodeWidth,LBarcodeHieght, dpi, dpi);
where IntToStr is a function that converts int to string
string IntToStr(int n)
{
stringstream result;
result << n;
return result.str();
}
Thank you & Best Regards.
Rania