Importing JPG on the fly error

Hi,

a client is storing the pictures on the server. I created the code below but I am keep getting the error that temp.bmp can not be found. Please any second look would help. I am getting crazy with this.

Please note that “File Name” already has “.jpg” included 122344.jpg

CODE BEGIN**

Path := ENVIRON(‘TEMP’) + ‘’;

JewelrySetup.CALCFIELDS(“Picture Converter”);
IF NOT EXISTS(Path + ‘PC.exe’) THEN
JewelrySetup.“Picture Converter”.EXPORT(Path + ‘PC.exe’);

WndStyle := 0;
Wait := TRUE;

IF EXISTS(JewelrySetupFilePath + “File Name”) THEN

BEGIN
CREATE(WshShell);
WshShell.Run(Path+'PC.exe -outfile ’ + ‘"’ +Path+'temp.bmp -color 256 -bmp ’ + ‘"’
+JewelrySetupFilePath + “File Name”,WndStyle,Wait);
CLEAR(WshShell);
Picture.IMPORT(Path+‘temp.bmp’,FALSE);
END
ELSE BEGIN
CLEAR(Picture);
END;

CODE END**

Have you checked if the file temp.bmp really exists ?
I could imagine that the conversion is not yet finished at the moment the PC.exe returns (even though you say “TRUE” for the wait).

If the file exists (I mean you checked it manually), try with a small sleep statement.

You are right temp.bmp does not exist.

Never mind I found the issue. Couple of small errors in the code, but the biggest was that Picture Converter corupted my images. Crazy