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

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

Postby Otto » Tue Nov 06, 2012 8: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: 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          
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6148
Joined: Fri Oct 07, 2005 7:07 pm

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

Postby Enrico Maria Giordano » Tue Nov 06, 2012 10:24 am

Otto,

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8419
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

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

Postby StefanHaupt » 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
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 36 guests

cron