A TActiveX working sample using Acrobat Reader 7

Post Reply
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

A TActiveX working sample using Acrobat Reader 7

Post by Enrico Maria Giordano »

Here it is:

Code: Select all

#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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: A TActiveX working sample using Acrobat Reader 7

Post by Enrico Maria Giordano »

This is an alternative:

Code: Select all

#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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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
User avatar
Adolfo
Posts: 815
Joined: Tue Oct 11, 2005 11:57 am
Location: Chile
Contact:

Post by Adolfo »

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
----------
Lenovo Legion Y520, 16GB Ram, 1 TB NVME M.2, 1 TB SSD, GTX 1050
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

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
Post Reply