Page 1 of 3

Crash from FWSavePreviewToPDF

PostPosted: Thu Jul 07, 2011 8:42 am
by byte-one
Hello Antonio, the new function FWSavePreviewToPDF( oPreview [, cPDFName ] ) crashes in WIN7! The Computer hangs.

Re: Crash from FWSavePreviewToPDF

PostPosted: Thu Jul 07, 2011 1:57 pm
by nageswaragunupudi
I guess these days FWH is developed on Windows 7. Unexpected problems may arise in XP.

I can think of one reason of failing while running without administrative rights. Can you please help us to isolate the problem by running as Administrator and check?

Here is a small sample that works here for me ( on Windows 7 ). You may substitute "customer.dbf" with any small simple dbf. Also please make sure you have freeimage.dll in the path.
Code: Select all  Expand view

#include "fivewin.ch"
function Main()

   TPreview():bSaveAsPDF := { | oPreview, cPDF | cPDF := FWSavePreviewToPDF( oPreview ), ;
                  If( Empty( cPDF ), , ShellExecute( oPreview:oWnd:hWnd, "open", cPDF ) ) }

   XBrowse( "CUSTOMER.DBF" )

return nil
 

Re: Crash from FWSavePreviewToPDF

PostPosted: Thu Jul 07, 2011 2:11 pm
by byte-one
I work with all privilegs in WIN7. Also I give the filename with a path with all rights. In VISTA all is OK! Whats the filename and path as default when not given?

Re: Crash from FWSavePreviewToPDF

PostPosted: Thu Jul 07, 2011 2:40 pm
by byte-one
If I wait a long time, these errormessage is coming:

Unrecoverable error 9006:
hb_xgrab cant allocate memory

Re: Crash from FWSavePreviewToPDF

PostPosted: Thu Jul 07, 2011 3:12 pm
by nageswaragunupudi
byte-one wrote:I work with all privilegs in WIN7. Also I give the filename with a path with all rights. In VISTA all is OK! Whats the filename and path as default when not given?


I suspected rights issue, because in the released version, some temporary files are being written to default directory and later erased. This will not be so in next releases.

If no file name is specified, the function prompts for a file name.

Have you tried the sample I posted? I understand you thought it might not be necessary, but I still request you to run the sample as it is and report the problem. That does help us. I would not have asked you, if we could reproduce the problem here.

Unrecoverable error 9006:
hb_xgrab cant allocate memory

This is a problem which may not happen on all systems at all times and if happens, is very difficult to debug, except by creating logs for each step.

We saw here another report of this error in this post though for a different reason. viewtopic.php?f=3&t=3172&hilit=9006

Once again I request to run the sample I posted and let us know the result.

By the way, may we know if you are using Harbour, xHarbour ( Borland / Microsoft ) or xHB commercial.

Re: Crash from FWSavePreviewToPDF

PostPosted: Thu Jul 07, 2011 11:11 pm
by byte-one
Same error with your sample! I use normal xHarbour that came with FWH and Borland-Compiler.

Re: Crash from FWSavePreviewToPDF

PostPosted: Fri Jul 08, 2011 12:20 am
by nageswaragunupudi
Thanks for the information.

Revised build of FWH 11.06 is published a little while ago. There are some changes in this function, though I am not sure if these changes can solve the problem you reported. I request you to please download the revised build and try.

Here is a sample that I tried with different versions of Borlad xHarbour and is working fine here on Windows 7 professional 32-bits.
Code: Select all  Expand view
#include 'fivewin.ch'
#include 'ord.ch'
#include 'xbrowse.ch'

REQUEST DBFCDX

function Main()

   RPrevUserBtns( nil, 2007 )
   TPreview():bSaveAsPDF := { | oPreview | FWSavePreviewToPDF( oPreview ) }
   RDDSetDefault( "DBFCDX" )
   XBrowse( "WWONDERS.DBF" )

return nil
 

"wwonders.dbf" is a foxpro comatible file in the \fwh\samples folder.

Here is a screenshot of the pdf:
Image

If you still have the problem, may I know what version of Windows-7 are you using? 32 or 64 bits? etc.

Re: Crash from FWSavePreviewToPDF

PostPosted: Fri Jul 08, 2011 6:59 am
by Enrico Maria Giordano
What your sample is supposed to do? I only see the browse at the end and nothing else. Is it all what I should get?

EMG

Re: Crash from FWSavePreviewToPDF

PostPosted: Fri Jul 08, 2011 8:28 am
by Antonio Linares
Enrico,

Please click on the bottom left button "Print" and you will get the preview, from there select the save as PDF option

Here it is working fine with Borland and Windows 7 Ultimate 64 bits :-)

Also is fine with FWH 64 and same Windows. FreeImage64.dll is still needed or a solution for it (access FreeImage.dll 32 bits from 64 bits app?)

Re: Crash from FWSavePreviewToPDF

PostPosted: Fri Jul 08, 2011 8:32 am
by Antonio Linares
Also fine with FWH 32 for Microsoft C++ 2010 and Windows 7 Ultimate 64 bits :-)

Re: Crash from FWSavePreviewToPDF

PostPosted: Fri Jul 08, 2011 8:50 am
by Enrico Maria Giordano
Antonio Linares wrote:Enrico,

Please click on the bottom left button "Print" and you will get the preview,


I don't get any preview. What am I missing?

EMG

Re: Crash from FWSavePreviewToPDF

PostPosted: Fri Jul 08, 2011 10:30 am
by Antonio Linares
byte-one wrote:If I wait a long time, these errormessage is coming:

Unrecoverable error 9006:
hb_xgrab cant allocate memory


Günther,

Do you get a calls stack with the error ? It may help very much to know where that call is made from, thanks :-)

Re: Crash from FWSavePreviewToPDF

PostPosted: Fri Jul 08, 2011 11:21 am
by Enrico Maria Giordano
Antonio Linares wrote:Enrico,

Please click on the bottom left button "Print"


I don't get any button "Print". I don't get anything at all, final browse apart. What am I doing wrong?

EMG

Re: Crash from FWSavePreviewToPDF

PostPosted: Fri Jul 08, 2011 11:37 am
by byte-one
Also with the new FWH the same error. I use WIN7 Home Premium 64Bits. Now the function ask to show the pdf. Should not be so!

All temporary files in the function should make in the temp-dir!!!

Antonio wrote:
Do you get a calls stack with the error ? It may help very much to know where that call is made from, thanks

No Antonio, no stack!

Re: Crash from FWSavePreviewToPDF

PostPosted: Fri Jul 08, 2011 1:46 pm
by Antonio Linares
Günther,

Please let me know when should be possible to have a TeamViewer session with you, as I would like to review your pc settings and build the test myself, thanks :-)