Crash from FWSavePreviewToPDF

Re: Crash from FWSavePreviewToPDF UPDATED!

Postby byte-one » Fri Jul 08, 2011 2:47 pm

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

Re: Crash from FWSavePreviewToPDF

Postby TimStone » Fri Jul 08, 2011 5:34 pm

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
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2904
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Crash from FWSavePreviewToPDF

Postby TimStone » Fri Jul 08, 2011 5:38 pm

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
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2904
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Crash from FWSavePreviewToPDF

Postby Antonio Linares » Fri Jul 08, 2011 6:34 pm

Tim,

Have you tested the small example provided by Rao ?

Please test it, 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 nageswaragunupudi » Sat Jul 09, 2011 3:48 am

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  Expand view
#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: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Crash from FWSavePreviewToPDF

Postby nageswaragunupudi » Sat Jul 09, 2011 4:15 am

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
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Crash from FWSavePreviewToPDF

Postby Antonio Linares » Sat Jul 09, 2011 10:39 am

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: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Crash from FWSavePreviewToPDF

Postby Antonio Linares » Sat Jul 09, 2011 5:49 pm

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: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Crash from FWSavePreviewToPDF

Postby Antonio Linares » Sat Jul 09, 2011 5:57 pm

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

Re: Crash from FWSavePreviewToPDF

Postby byte-one » Sun Jul 10, 2011 10:46 pm

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

Re: Crash from FWSavePreviewToPDF

Postby gkuhnert » Mon Jul 11, 2011 2:09 pm

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
User avatar
gkuhnert
 
Posts: 274
Joined: Fri Apr 04, 2008 1:25 pm
Location: Aachen - Germany // Kerkrade - Netherlands

Re: Crash from FWSavePreviewToPDF

Postby Gale FORd » Mon Jul 11, 2011 3:26 pm

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.
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Re: Crash from FWSavePreviewToPDF

Postby nageswaragunupudi » Mon Jul 11, 2011 4:34 pm

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
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Crash from FWSavePreviewToPDF

Postby Gale FORd » Mon Jul 11, 2011 4:45 pm

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.
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Re: Crash from FWSavePreviewToPDF

Postby hua » Tue Jul 12, 2011 1:52 am

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.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1038
Joined: Fri Oct 28, 2005 2:27 am

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Silvio.Falconi and 95 guests