Page 1 of 1

Try-catch-end - Symbol item expected from hb_vmDo()

PostPosted: Tue Nov 06, 2012 8:59 am
by Otto
To all,
I am not sure how Try-catch-end should work

I use it like the following code shows but get an error.
(cBuf := DibToStr( hDib) causes the error)

MsgBox with:
Symbol item expected from hb_vmDo()
and the program stops.
Best regards,
Otto


Code: Select all  Expand view
TRY
         hBmp2             := CropImage( hBmp, 130, 10, nBmpHeight( hBmp ) - 35, nBmpWidth( hBmp ) - 20 )
         DeleteObject( hBmp )
         hDib              := DibFromBitmap( hBmp2 )
         
         cBuf              := DibToStr( hDib )
         
         GlobalFree( hDib )

         DeleteObject( hBmp2 )
         lRet              := BmpBufToJpg( cFileSetExt( cPDF, "jpg" ), cBuf )
         cBuf              := nil
CATCH
msginfo( procname() + " CATCH  " + str(procline()) + "   " + str( 1 ) )
END          

Re: Try-catch-end - Symbol item expected from hb_vmDo()

PostPosted: Tue Nov 06, 2012 10:24 am
by Enrico Maria Giordano
Otto,

can you build a sample that can be compiled, please?

EMG

Re: Try-catch-end - Symbol item expected from hb_vmDo()

PostPosted: Tue Nov 06, 2012 10:26 am
by StefanHaupt
Otto,

you use it in the right way.

DibToStr() is c-function, maybe TRY..CATCH can´t handle internal c-errors. Is the messagebox displayed ?