To Antonio : Preview in FWH 10.12

Re: To Antonio : Preview in FWH 10.12

Postby nageswaragunupudi » Thu Jan 27, 2011 5:33 am

Another thing is that it seems like the new rpreview will NOT take into consideration when the app is themed to add the new buttons...?

It is so with both new and old rpreviews. There is no change in this present version.

If the application has a main window and the main window has buttonbar and the buttonbar has l2007 style OR IsAppThemed() is false, RPreview uses FWH's own TBar as the buttonbar. Otherwise it uses Rebar. Since providing interface for Rebar for the additional buttons was a bit complex, it was not provided in this case even originally.

In other words this interface of providing additional buttons was made available where IsAppThemed() is .f. OR the application has main window with a buttonbar with l2007 style, whether or not the app is themed.

Notice the text "factor" overlaps the exit button. Can someone help?
 

This is noticed. Soon a fix will be made available.
Regards

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

Re: To Antonio : Preview in FWH 10.12

Postby nageswaragunupudi » Thu Jan 27, 2011 6:14 am

Mr. Michel and Mr. Horizon

The problem is the compatibility of the new olefuncs.prg with xHb.
Can you further help me?
Please copy all the functions in the olefuncs.prg to the end of the sample program I have posted before and then rename all functions as static functions. Then please compile and link without the original olefuncs.prg and test this new program.
Can you please test this and let us know the result?
Regards

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

Re: To Antonio : Preview in FWH 10.12

Postby driessen » Thu Jan 27, 2011 8:59 am

Mr. Nao,

I tested as you ask me to.

I copied all the function of olefuncs.prg into my test.prg and I made them all static.

I build my application and ran it. But the result is just the same. The first msginfo appears, the second one doesn't.

Thanks.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: To Antonio : Preview in FWH 10.12

Postby nageswaragunupudi » Thu Jan 27, 2011 9:29 am

We need to test line by line.

Meanwhile I thought I would test it myself with xHb. I downloaded demo version (September 2010) from xharbour.com and tried to build a very simple program with just one statement
Code: Select all  Expand view
msginfo( 'xhb' )

I got linking errors:
Code: Select all  Expand view
xLINK: error: Unresolved external symbol '??2@YAPAXI@Z referenced from Fivehcm.lib(ACTX.obj)'.

xLINK: error: Unresolved external symbol '??3@YAXPAX@Z referenced from Fivehcm.lib(ACTX.obj)'.

 

Can you guide me how are you able to link xhb with fwh?
Regards

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

Re: To Antonio : Preview in FWH 10.12

Postby Horizon » Thu Jan 27, 2011 9:46 am

Hi Mr. Rao,

download http://www.objekt.com.tr/fwh_test/xhb.rar, open it. add the xhb.obj to the xHarbour Builder.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1289
Joined: Fri May 23, 2008 1:33 pm

Re: To Antonio : Preview in FWH 10.12

Postby driessen » Thu Jan 27, 2011 10:28 am

Mr. Rao,

Indeed, as told, you need to add xhb.obj.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: To Antonio : Preview in FWH 10.12

Postby nageswaragunupudi » Thu Jan 27, 2011 11:51 am

Mr. Horizon and Mr. Michel

Thanks for the help. I have linked xhb.obj and now I am able to compile and link. Where do we get this xhb.obj and what is it?

Coming to our issue:

Please see the code of function GetOleObject( cApp ) in the OLEFUNCS.PRG.
Code: Select all  Expand view
static function GetOleObject( cApp )

   local oObj

   TRY
      oObj  := GetActiveObject( cApp )
   CATCH
      TRY
         oObj  := CreateObject( cApp )
      CATCH
      END
   END

return oObj
 

This is the normal way we create Excel or Word objects. When I tried this today with xhb, the execution fails at GetActiveObject()
What is your experience? XBrowse.prg uses the same construct to create excel object till last version.

When I substituted the above with TOleAuto():New(cApp) it worked for me.

I now advise you to replace the function with this function in OLEFUNCS.PRG and link with your application and let me know the result.
Code: Select all  Expand view
static function GetOleObject( cApp )

   local oObj

   TRY
      oObj  := TOleAuto():New( cApp )
   CATCH
   END

return oObj
 


Also please remove the module OLEFUNCS from the 'fivehm.lib' with whatever LIB utility you use.
Regards

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

Re: To Antonio : Preview in FWH 10.12

Postby nageswaragunupudi » Thu Jan 27, 2011 1:13 pm

With the above change in olefuncs.prg export to word and save as pdf are working for me.
Please test and confirm.
Regards

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

Re: To Antonio : Preview in FWH 10.12

Postby driessen » Thu Jan 27, 2011 1:15 pm

Mr. Rao,

I tested your suggestion and it indeed works fine now.

I also added your GetOleObject() to the latest RPREVIEW class in my application and it worked fine also.

To my opinion, we have got a solution.

Thank you very much for your help.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77
User avatar
driessen
 
Posts: 1399
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Re: To Antonio : Preview in FWH 10.12

Postby nageswaragunupudi » Thu Jan 27, 2011 1:27 pm

driessen wrote:Mr. Rao,

I tested your suggestion and it indeed works fine now.

I also added your GetOleObject() to the latest RPREVIEW class in my application and it worked fine also.

To my opinion, we have got a solution.

Thank you very much for your help.

This may not be enough. You may get problem with XBrowse ToExcel() method, because that method now uses ExcelObj() from the olefuncs.prg.

Better solution is, please modify the GetOleObj function in the olefuncs.prg as we suggested above. Remove the olefuncs.obj from fivehmx.lib and add the new obj.

This is a better way.

Next:
1) Can you help me to find out why GetActiveObj() is failing? Can you test this?
2) For conditional compiling, we check #ifdef __XHARBOUR__ to ascertain that we are compiling with xHarbour. Is there any such constant to check if we are compiling with commerical xHarbour?
Regards

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

Re: To Antonio : Preview in FWH 10.12

Postby nageswaragunupudi » Sun Feb 13, 2011 10:35 pm

nageswaragunupudi wrote:
May I ask; Is there a way also to remove buttons? I mean; may I remove the word and pdf buttons?

As of now, the answer is No.
Either we need to modify the code or much better include 10.11 rpreview.prg in our application which overrides the current rpreview.prg.

Probably, if that is our wish, FWH may provide for more customization of the buttons and bar possible in the next release.


In continuation to my above post, let me correct myself. It is possible to remove the two or all buttons and substitute with our own buttons.

Sample code:
Code: Select all  Expand view
function ReportExtend( oPreview, oBar )

   // remove last two buttons
   oBar:Del( Len( oBar:aControls ) )
   oBar:Del( Len( oBar:aControls ) )

   // now add our own buttons

   DEFINE BUTTON OF oBar ;
      RESOURCE 'SAVE' ;  // from our resource or bitmap file
      TOOLTIP 'Save To PDF' ;
      ACTION Preview2PDF( oPreview )

< continue with our code >

 
Regards

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

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

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