Crash from FWSavePreviewToPDF

User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: Crash from FWSavePreviewToPDF UPDATED!

Post by byte-one »

Antonio, the computer (laptop) with the problems in the moment is not reachable! Is it possible, that the computer has to low memory? He has only 1 Gb.

Or the problem comes from cTempfile() ????
Without a path-parameter .\ is default and in this path no rights existing in win7 in circumstances. This temp-file should be in temp-directory as default. I have also problems with timage:saveimage(). In this method cTempfile() is calling.

A possible code:

Code: Select all

function temp_path()
local cPath := ".\"
do case
    case !empty(getenv("TEMP"))
        cPath := getenv("TEMP")+"\"
    case !empty(getenv("TMP"))
        cPath := getenv("TMP")+"\"
    endcase
return cPath
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Re: Crash from FWSavePreviewToPDF

Post by TimStone »

I just created a build with 11.06 and tried the tPreview class. ( I usually use my own which supports PDF and email, plus has larger icons ).

I can get a preview, but when using the Word or PDF options, the program gets a Windows error ( the .exe has stopped ). I am logged in as the Administrator, and I tried Run as Administrator also. I get the same results.

Win 7 Ultimate 32
FWH 11.6
xBuilder compiler ( xcc )

I used the download from this morning ( built 7/7 at 9:30 PM )

Tim
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
TimStone
Posts: 2536
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Contact:

Re: Crash from FWSavePreviewToPDF

Post by TimStone »

I should add that all of my reports are manually constructed with the PRINTER commands:

PRINT oPrn NAME "Daily Totals" PREVIEW
Tim Stone
http://www.MasterLinkSoftware.com
timstone@masterlinksoftware.com
Using: FWH 19.06 with Harbour 3.2.0 / Microsoft Visual Studio Community 2019
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Crash from FWSavePreviewToPDF

Post by Antonio Linares »

Tim,

Have you tested the small example provided by Rao ?

Please test it, thanks :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Crash from FWSavePreviewToPDF

Post by nageswaragunupudi »

Mr. Antonio

Please see Mr. Tim's posting:
I can get a preview, but when using the Word or PDF options, the program gets a Windows error ( the .exe has stopped ).
You are aware that this happens with xHarbour commercial (also with some specific versions of xHarbour), while executing GetActiveObject() function in "olefuncs.prg". This was reported by some users and solution provided in these forums as well as personally by email by you.

Please see the header of \fwh\source\function\olefuncs.prg:

Code: Select all

#include "fivewin.ch"

// xHarbour Commerical users may uncomment the next line
// #define ___XHB___
 
If olefuncs.prg is compiled uncommenting this define and linked, it works well.
Can you consider releasing FiveHCM.lib and FiveHMX.lib with this change?
Regards

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

Re: Crash from FWSavePreviewToPDF

Post by nageswaragunupudi »

Or the problem comes from cTempfile() ????
SaveToPDF function saves any temporary files to the folder where the meta files were already created by TPreview. If we are able to see preview, it means the meta files were already created successfully in some temporary folder and creating other temporary files in the same folder should not result in any problems.

Nonetheless, the problems that might arise due to the present use of cTempFile() need to be looked into.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Crash from FWSavePreviewToPDF

Post by Antonio Linares »

Rao,
If olefuncs.prg is compiled uncommenting this define and linked, it works well.
Can you consider releasing FiveHCM.lib and FiveHMX.lib with this change?
We need to find a way to distinguish between xHarbour and xHarbour commercial based on a compiler define

Does exist such define ?
regards, saludos

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

Re: Crash from FWSavePreviewToPDF

Post by Antonio Linares »

It seems as we could use:

#ifdef __XCC__ // Just exist for xHarbour commercial
#define ___XHB___
#endif

but it seems as Rao has already solved it without the need for this define :-)
regards, saludos

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

Re: Crash from FWSavePreviewToPDF

Post by Antonio Linares »

For those using xHarbour commercial, please try this lib and try again the preview example:

http://fivewin.googlecode.com/files/Fivehcm.lib
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
byte-one
Posts: 1048
Joined: Mon Oct 24, 2005 9:54 am
Location: Austria
Contact:

Re: Crash from FWSavePreviewToPDF

Post by byte-one »

Now I have do other tests and I found, that the error only come with greater previews with some pages! One or two pages are functioning best. Some memory-request are not released from page to page??
Its very important to correct the ctempfile() and all other paths in the exe-directory (c:\program files, etc.) as soon as possible. In WIN7 there are no rights to write in this directory as default! This problem are also with ther "error.log". The standard should be also the temp-directory.
Regards,
Günther
---------------------------------
office@byte-one.com
User avatar
gkuhnert
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands
Contact:

Re: Crash from FWSavePreviewToPDF

Post by gkuhnert »

Just tested a print preview with 1621 pages to save it with the button in the preview and it was no problem (it took about 2 minutes). However, my system is a Win7 with 8GB memory.
Best Regards,

Gilbert Kuhnert
CTO Software GmbH
http://www.ctosoftware.de
Gale FORd
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston
Contact:

Re: Crash from FWSavePreviewToPDF

Post by Gale FORd »

I had this problem also. Uncommented #define ___XHB___ in olefuncs.prg and it works.

Also what icon does the preview use for word and pdf option? My preview just has an empty spot on the toolbar.
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Crash from FWSavePreviewToPDF

Post by nageswaragunupudi »

Gale FORd wrote:I had this problem also. Uncommented #define ___XHB___ in olefuncs.prg and it works.

Also what icon does the preview use for word and pdf option? My preview just has an empty spot on the toolbar.
You can also use the revised fivehcM.lib. Please download from the link posted by Mr. Antonio in the post above. http://fivewin.googlecode.com/files/Fivehcm.lib

If you do not see any buttons, it means you are using an older version of prev32.dll. Please copy the latest prev32.dll from \fwh\dll folder to your working folder.
Regards

G. N. Rao.
Hyderabad, India
Gale FORd
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston
Contact:

Re: Crash from FWSavePreviewToPDF

Post by Gale FORd »

I tried that file but it did not solve the problem. I am now being very careful that the files i am downloading or saving actually overwrite the previous file.
hua
Posts: 861
Joined: Fri Oct 28, 2005 2:27 am

Re: Crash from FWSavePreviewToPDF

Post by hua »

I wish changes that affects UI such as this is disabled by default. That way, whatever changes need to be dealt with can be done at a later time without having to postpone linking in latest FWH to resolve whatever bugs that might exist.
FWH 11.08/FWH 19.03
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
Post Reply