FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Crash from FWSavePreviewToPDF
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Crash from FWSavePreviewToPDF
Posted: Thu Jul 07, 2011 08:42 AM

Hello Antonio, the new function FWSavePreviewToPDF( oPreview [, cPDFName ] ) crashes in WIN7! The Computer hangs.

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Crash from FWSavePreviewToPDF
Posted: Thu Jul 07, 2011 01:57 PM
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 (fw): Select all Collapse
#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
Regards



G. N. Rao.

Hyderabad, India
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Crash from FWSavePreviewToPDF
Posted: Thu Jul 07, 2011 02:11 PM

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?

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Crash from FWSavePreviewToPDF
Posted: Thu Jul 07, 2011 02:40 PM

If I wait a long time, these errormessage is coming:

Unrecoverable error 9006:
hb_xgrab cant allocate memory

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Crash from FWSavePreviewToPDF
Posted: Thu Jul 07, 2011 03:12 PM
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.
Regards



G. N. Rao.

Hyderabad, India
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Crash from FWSavePreviewToPDF
Posted: Thu Jul 07, 2011 11:11 PM

Same error with your sample! I use normal xHarbour that came with FWH and Borland-Compiler.

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Crash from FWSavePreviewToPDF
Posted: Fri Jul 08, 2011 12:20 AM
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 (fw): Select all Collapse
#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:


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



G. N. Rao.

Hyderabad, India
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Crash from FWSavePreviewToPDF
Posted: Fri Jul 08, 2011 06:59 AM

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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Crash from FWSavePreviewToPDF
Posted: Fri Jul 08, 2011 08:28 AM

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?)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Crash from FWSavePreviewToPDF
Posted: Fri Jul 08, 2011 08:32 AM

Also fine with FWH 32 for Microsoft C++ 2010 and Windows 7 Ultimate 64 bits :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Crash from FWSavePreviewToPDF
Posted: Fri Jul 08, 2011 08:50 AM
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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Crash from FWSavePreviewToPDF
Posted: Fri Jul 08, 2011 10:30 AM
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 :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Crash from FWSavePreviewToPDF
Posted: Fri Jul 08, 2011 11:21 AM
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
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
Re: Crash from FWSavePreviewToPDF
Posted: Fri Jul 08, 2011 11:37 AM
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!
Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Crash from FWSavePreviewToPDF
Posted: Fri Jul 08, 2011 01:46 PM

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 :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com