How to do my question ?

How to do my question ?

Postby yunbg1 » Thu May 28, 2020 5:21 pm

Dear Antonio Linares.

How to do my question ?

When using activeX "AcroPDF.PDF.1"
How to receive event (current status) in activeX?

For example, I want to know the event or status value when the printWithDialog () window is closed.

Thank you.
FWH User
FWPPC User
FWLinux User
yunbg1
 
Posts: 107
Joined: Sun Nov 13, 2005 12:40 am
Location: Winnipeg Canada

Re: How to do my question ?

Postby Antonio Linares » Thu May 28, 2020 7:47 pm

Please review FWH\samples\webexp.prg to review how to manage the ActiveX events
regards, saludos

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

Re: How to do my question ?

Postby yunbg1 » Thu May 28, 2020 11:01 pm

Code: Select all  Expand view

#include "FiveWin.ch"

//---------------------------------------------------------------------------------------------------
FUNC Test()

publ oWnd_Main, oDlgW, oActiveX
publ cEvents := ""

DEFINE WINDOW oWnd_Main FROM 0, 0 TO 48, 128  TITLE "PDF.Print"

      //sample #1
      /*
          DEFINE DIALOG oDlgW OF oWnd_Main FROM 110, 20 TO 730, 300 TITLE "" STYLE nOr(DS_MODALFRAME) PIXEL
              oActiveX := TActiveX():New( oDlgW, "AcroPDF.PDF.1" )
              oDlgW:oClient := oActiveX
              oActiveX:bOnEvent := { | event, aParams, pParams | EventInfo( event, aParams, pParams ) }
          ACTIVATE DIALOG oDlgW NOWAIT ON INIT pdf_run(0)
     */


      //sample #2
      @ 0, 0 ACTIVEX oActiveX PROGID "AcroPDF.PDF.1" OF oWnd_Main
          oActiveX := TActiveX():New( oWnd_Main, "AcroPDF.PDF.1" )
          oWnd_Main:oClient := oActiveX
                  oActiveX:bOnEvent = { | event, aParams, pParams | cEvents += EventInfo( event, aParams, pParams ) }

ACTIVATE WINDOW oWnd_Main ON INIT pdf_run(0) VALID ( MemoEdit( cEvents ), .t. )

RETU NIL

//----------------------------------------------------------------------------
FUNC pdf_run()

oActiveX:Do( "LoadFile", curdrive1()+"\test.pdf" )
oActiveX:Do( "SetCurrentPage", 1 )

oActiveX:Do("SetShowToolbar", 0)
oActiveX:Do("SetView", "fit")
oActiveX:Do("SetPageMode", "none")
oActiveX:Do("SetShowScrollbars", 0)
oActiveX:Do("SetPageMode", "bookmarks")

RETU NIL

//----------------------------------------------------------------------------
FUNC EventInfo( event, aParams, pParams )

cMsg := "Event: " + cValToChar( event ) + CRLF
cMsg += "Params: " + CRLF
for n := 1 to Len( aParams )
   cMsg += cValToChar( aParams[ n ] ) + CRLF
next

file_name := curdrive1()+"\log_activex"+".txt"
LogFile( file_name, { cMsg } )

//event := cValToChar( event )

RETU cMsg+CRLF

//------------------------------------------------------------------------------
#pragma BEGINDUMP

#include "windows.h"
#include "hbapi.h"

HB_FUNC(CURDRIVE1)
{
   char buffer[1024];
   GetCurrentDirectory(MAX_PATH, buffer);

   hb_retc(buffer);
}

#pragma ENDDUMP
 


he "webexp.prg" sample works fine
But look at what's wrong with "AcroPDF.PDF.1"
FWH User
FWPPC User
FWLinux User
yunbg1
 
Posts: 107
Joined: Sun Nov 13, 2005 12:40 am
Location: Winnipeg Canada


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: wilsongamboa and 50 guests