How to use DLL-Events???

storzi

Member
Hi,

we have the PDF-Printer "eDocPrintPro" in use.
We can activate and access the ole-Object with the following code in Progress (9.1d):
Code:
DEF VAR edoc            AS COM-HANDLE NO-UNDO.             
DEF VAR actionpage      AS COM-HANDLE NO-UNDO.
DEF VAR destinationpage AS COM-HANDLE NO-UNDO.  
DEF VAR layoutpage      AS COM-HANDLE. 

CREATE "eDocPort.port" edoc.

    IF VALID-HANDLE(edoc) THEN DO:

        /* EDOCPRINTER ERMITTELN */
        pcount = edoc:getprinterscount().
        edocprinter = edoc:getprinternamefromindex(pcount).

        /* EDOCPRINT HANDLES ZUWEISEN */
        actionpage = edoc:getactionpage(edocprinter).
        destinationpage = edoc:getdestinationpage(edocprinter).
        layoutpage = edoc:getlayoutpage(edocprinter).

        /* AKTUELLE EDOCPRINTPRO EINSTELLUNGEN ZUWEISEN */
        actionpage:readsettings().
        destinationpage:readsettings().
        layoutpage:readsettings().
    end.
This reads the settings for the PDF-Printer and works fine.

In the Example-VB-Code from the PDF-Printer-Company are also some events:
Events:
OnStartDocPort
parameters: none
comments: the event is raised before the printing and can be used for printer customization
OnEndDocPort
parameters: none
comments: the event is raised after finishing the output files creation and can be used for post processing


Now my question:
How can I implement these events in progress?

Thanks for any help.

Greets
storzi
 

storzi

Member
progress self can't handle such events as far as i know.
In the documentation "Progress External Program Interfaces" I read, that
Code:
edoc:ENABLE-EVENTS("port").
PROCEDURE port.OnEndDocPort:
     message "Event OnEndDocPort".
END.
should work.

but look at the MessageBlaster OCX (msgblst32.ocx) i think it can help you.
Thanks. I will take a look at it.
 

storzi

Member
No problem.
But
Code:
edoc:ENABLE-EVENTS("port").
PROCEDURE port.OnEndDocPort:
     message "Event OnEndDocPort".
END.
doesn`t work.
 

robsoncruzjr

New Member
Do you know if that works on 9.1e?
I'm trying to use it on 9.1e but it doesn't works. I tried it on 10.1c and it worked perfectly. Thanks
 

kluzra

New Member
I'm using 10.1b and trying to encorporate the API with my structure .p program. I'm not having any luck. I put the Event Procedures in the main section. I have the Enable-Events called in a procedure of the .p right after com-handle is assigned/validated, with the com-handle of the dll declared in the definitions.

Thanks,
Russ
 
Top