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.
How to do my question ?
How to do my question ?
FWH User
FWPPC User
FWLinux User
FWPPC User
FWLinux User
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: How to do my question ?
Please review FWH\samples\webexp.prg to review how to manage the ActiveX events
Re: How to do my question ?
Code: Select all
#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
But look at what's wrong with "AcroPDF.PDF.1"
FWH User
FWPPC User
FWLinux User
FWPPC User
FWLinux User