FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Error win32ole.prg => TOLEAUTO:ADJCLIENT(0)
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Error win32ole.prg => TOLEAUTO:ADJCLIENT(0)
Posted: Sat Dec 15, 2007 04:35 PM

I'm getting this error working with activex crystal reports. Does anyone knows the reason?
When the window with the oViewer control gets activated I get the error.
Otherwise all ole control of the object works ok.

Any ideas ?

Antonio

Regards

Antonio H Ferreira
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Error win32ole.prg => TOLEAUTO:ADJCLIENT(0)
Posted: Sat Dec 15, 2007 04:52 PM

Are you using xHarbour ?

If yes, then add this before using TOleAuto:

EXTEND CLASS TOLEAUTO WITH METHOD AdjClient

static function AdjClient() ; return nil

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Error win32ole.prg => TOLEAUTO:ADJCLIENT(0)
Posted: Sun Dec 16, 2007 10:12 AM

Antonio,

Thanks, but now the viewer object doesn't apper on the window.

The reports works ok to the printer but not to the screen.
Here is the code that should work ok.

DEFINE WINDOW oWnd TITLE cTitle

   oCRViewer := ToleAuto():New("CrystalReports.ActiveXReportViewer" )

   oCRViewer:EnableExportButton :=1
   oCRViewer:EnableStopButton:= 1
   oCRViewer:EnableNavigationControls:=1
   oCRViewer:EnablePopupMenu:=0
   oCRViewer:EnableCloseButton:=0
   if lPcdata
      oCRViewer:DisplayGroupTree:=0
      oCRViewer:EnableDrillDown:=0
      oCRViewer:EnableGroupTree:=0
   endif
   oCRViewer:ReportSource:= oReport

   oCRViewer:ViewReport()
   oCrViewer:Zoom:=75

   oWnd:oClient := oCRViewer


   ACTIVATE WINDOW oWnd MAXIMIZED ;
   VALID (oReport:CancelPrinting(),oCrystal:CanClose() )
Regards

Antonio H Ferreira
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Error win32ole.prg => TOLEAUTO:ADJCLIENT(0)
Posted: Sun Dec 16, 2007 10:29 AM
This is a sample that I successfully tried in the past (please note that I don't have CR installed now and therefore I can't test it anymore):

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oCrystal := CREATEOBJECT( "CrystalRuntime.Application" )
    LOCAL oReport  := oCrystal:OpenReport( "PROVA.RPT" )

    LOCAL oWnd, oCRViewer

    DEFINE WINDOW oWnd

    oCRViewer = TActiveX():New( oWnd, "CRViewer9.CRViewer" )

    oCRViewer:SetProp( "ReportSource", oReport )
    oCRViewer:Do( "ViewReport" )

    oWnd:oClient = oCRViewer

    ACTIVATE WINDOW oWnd;
             MAXIMIZED

    RETURN NIL


EMG
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Error win32ole.prg => TOLEAUTO:ADJCLIENT(0)
Posted: Sun Dec 16, 2007 10:37 AM

Basiclly codes are identical. I use Cr 11 so the app ids changed.
It used to work with previous version of Harbour (don't know versiom) but now with xHarbour March 2006 and FWH March 2006 it doesn't anymore.

Antonio

Regards

Antonio H Ferreira
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Error win32ole.prg => TOLEAUTO:ADJCLIENT(0)
Posted: Sun Dec 16, 2007 10:57 AM

Antonio, Enrico,

Does oCRViewer provide a property to access its window handle ?

That is what we need to make AdjClient() work fine

Enrico's example is using a TActiveX which is derived from TControl, so AdjClient() works fine with it

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Error win32ole.prg => TOLEAUTO:ADJCLIENT(0)
Posted: Sun Dec 16, 2007 11:31 AM

Changing from toleauto to tactivex I get the error :

Error description: Error BASE/1004 Class: 'NUMERIC' has no exported method: HWND
Args:

Stack Calls

Called from: => HWND(0)
Called from: TActiveX.prg => TACTIVEX:NEW(0)
Called from: TActiveX.prg => CREATEACTIVEX(184)
Called from: TActiveX.prg => TACTIVEX:NEW(0)
Called from: crtfwup.PRG => MAIN(275)

Regards

Antonio H Ferreira
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Error win32ole.prg => TOLEAUTO:ADJCLIENT(0)
Posted: Sun Dec 16, 2007 12:23 PM

No oCrviewer doesn't have any property to put the window handle.

Antonio

Regards

Antonio H Ferreira
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Error win32ole.prg => TOLEAUTO:ADJCLIENT(0)
Posted: Sun Dec 16, 2007 03:48 PM

Antonio,

Are you using xHB commercial ?

It looks so as you are linking Class TActiveX from xHB commercial instead of Class TActiveX from FWH

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Error win32ole.prg => TOLEAUTO:ADJCLIENT(0)
Posted: Sun Dec 16, 2007 04:52 PM

Antonio,

Thanks, problem solved.

Regards

Antonio H Ferreira

Continue the discussion