FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Try-catch-end - Symbol item expected from hb_vmDo()
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
Try-catch-end - Symbol item expected from hb_vmDo()
Posted: Tue Nov 06, 2012 08:59 AM
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 (fw): Select all Collapse
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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Try-catch-end - Symbol item expected from hb_vmDo()
Posted: Tue Nov 06, 2012 10:24 AM

Otto,

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

EMG

Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: Try-catch-end - Symbol item expected from hb_vmDo()
Posted: Tue Nov 06, 2012 10:26 AM

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 ?

kind regards

Stefan

Continue the discussion