FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour tActivex
Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
tActivex
Posted: Sat Mar 15, 2008 02:17 AM

Hi

I found this code sample by Enrico for displaying a pdf

oPdf := TActiveX():New( oWnd, "AcroPDF.PDF" )
oPdf:Do( "LoadFile", "WIP-14.PDF")
oWnd:oClient := oPdf

This works fine but when I place the code in the action of a button
the "oWnd:oClient := oPdf" does not work , the pdf opens but is not
a client of oWnd - how can I set it to work properly.

Regards

Colin

Posts: 866
Joined: Tue Oct 16, 2007 08:57 AM
tActivex
Posted: Sat Mar 15, 2008 02:39 AM
Hi

I think you can try it below:

Function Main()
Local oWnd, oBtn

        DEFINE WINDOW oWnd TITLE "Main Window"
        ............
        @ 5, 5 Button ...... Action OpenPDF()

        ACTIVATE WINDOW oWnd

RETURN NIL

Function OpenPDF()
LOCAL oPdfWnd, oPdf

      DEFINE WINDOW oPdfWnd TITLE "Open PDF Window"

                 oPdf := TActiveX():New( oPdfWnd, "AcroPDF.PDF" ) 
                 oPdf:Do( "LoadFile", "WIP-14.PDF") 
                 oPdfWnd:oClient := oPdf 
      
      ACTIVATE WINDOW oPdfWnd

RETURN NIL


Regards,

Richard
Best Regards,



Richard



Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 32bit

MySQL v8.0

Harbour 3.2.0dev (r2503251254) => Borland C++ v7.7 64bit

Continue the discussion