Crash from FWSavePreviewToPDF

Crash from FWSavePreviewToPDF

Postby byte-one » Thu Jul 07, 2011 8:42 am

Hello Antonio, the new function FWSavePreviewToPDF( oPreview [, cPDFName ] ) crashes in WIN7! The Computer hangs.
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Crash from FWSavePreviewToPDF

Postby nageswaragunupudi » Thu Jul 07, 2011 1: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: 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
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Crash from FWSavePreviewToPDF

Postby byte-one » Thu Jul 07, 2011 2: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
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Crash from FWSavePreviewToPDF

Postby byte-one » Thu Jul 07, 2011 2: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
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Crash from FWSavePreviewToPDF

Postby nageswaragunupudi » Thu Jul 07, 2011 3: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
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Crash from FWSavePreviewToPDF

Postby byte-one » 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
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Crash from FWSavePreviewToPDF

Postby nageswaragunupudi » 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: 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.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Crash from FWSavePreviewToPDF

Postby Enrico Maria Giordano » Fri Jul 08, 2011 6: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
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Crash from FWSavePreviewToPDF

Postby Antonio Linares » Fri Jul 08, 2011 8: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Crash from FWSavePreviewToPDF

Postby Antonio Linares » Fri Jul 08, 2011 8:32 am

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Crash from FWSavePreviewToPDF

Postby Enrico Maria Giordano » Fri Jul 08, 2011 8: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
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Crash from FWSavePreviewToPDF

Postby Antonio Linares » 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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Crash from FWSavePreviewToPDF

Postby Enrico Maria Giordano » 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
User avatar
Enrico Maria Giordano
 
Posts: 8315
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Crash from FWSavePreviewToPDF

Postby byte-one » 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
User avatar
byte-one
 
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria

Re: Crash from FWSavePreviewToPDF

Postby Antonio Linares » Fri Jul 08, 2011 1: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 81 guests