FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour A TActiveX working sample using Acrobat Reader 7
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
A TActiveX working sample using Acrobat Reader 7
Posted: Sun May 28, 2006 07:25 AM
Here it is:

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd, oPdf

    DEFINE WINDOW oWnd

    oPdf = TActiveX():New( oWnd, "{CA8A9780-280D-11CF-A24D-444553540000}" )

    oPdf:Do( "LoadFile", "filename" )

    oWnd:oClient = oPdf

    ACTIVATE WINDOW oWnd

    RETURN NIL


EMG
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: A TActiveX working sample using Acrobat Reader 7
Posted: Sun May 28, 2006 12:50 PM
This is an alternative:

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oWnd, oPdf

    DEFINE WINDOW oWnd

    oPdf = TActiveX():New( oWnd, "AcroPDF.PDF" )

    oPdf:Do( "LoadFile", "filename" )

    oWnd:oClient = oPdf

    ACTIVATE WINDOW oWnd

    RETURN NIL


But they have a problem: the process AcroRd32.exe remains active after the end of the sample execution. Is there any way to unload it? I already tried various options without success: oPdf:End(), oPdf:Do( "Close" ), DeleteObject( oPdf:hActiveX ), etc.

EMG
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
A TActiveX working sample using Acrobat Reader 7
Posted: Mon May 29, 2006 11:01 AM

Enrico,

Have you checked if after some time it gets unloaded ? Sometimes the activex remains loaded for some time and later on it gets closed.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
A TActiveX working sample using Acrobat Reader 7
Posted: Mon May 29, 2006 11:19 AM

No, I will check it, thank you.

EMG

Posts: 883
Joined: Tue Oct 11, 2005 11:57 AM
A TActiveX working sample using Acrobat Reader 7
Posted: Mon May 29, 2006 12:56 PM
Antonio Linares wrote:Enrico,

Have you checked if after some time it gets unloaded ? Sometimes the activex remains loaded for some time and later on it gets closed.



Antonio, is there a way to know if the Activex Control is already loaded on memory, and a way to unloaded it if is true.

While doing some tests with an epson ocx, I got plenty of problems, I needed to reboot to make things work, so I think it was because it get loaded...

Any idea
;-) Ji,ji,ji... buena la cosa... "all you need is code"

http://www.xdata.cl - Desarrollo Inteligente
----------
Asus TUF F15, 32GB Ram, 2 * 1 TB NVME M.2, GTX 1650
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
A TActiveX working sample using Acrobat Reader 7
Posted: Mon May 29, 2006 02:07 PM

Adolfo,

With some OCXs, like Acrobat Reader, if you press Ctrl+Alt+Del you can see AcroRd32.exe is loaded.

On some other OCXs where EXEs are not used, it may be more difficult to know it.

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion