How do you recommend I create the CDIntf object and capture the EnablePre event in Foxpro. I have subclassed the CDIntf object and I create a form on the fly and add the object to the form, Call the DriverInit of the CDIntf object and call CaptureEvents.
PUBLIC loAmyuniPDFForm as Form
loAmyuniPDFForm= CREATEOBJECT("Form")
loAmyuniPDFForm.ADDOBJECT("CDIntfEx","CDIntfEx")
loCDIntfEx = loAmyuniPDFForm.CDIntfEx
loCDIntfEx.DriverInit("IMS PDF Printer")
loCDIntfEx.CaptureEvents(.t.)
the EnablePre event DOES NOT fire when this code is run within the applicaton. If I run this code from the command prompt everything works fine. If I run this code from ANOTHER instance of Foxpro it works. What am I doing wrong here. Any help would be appreciated.
Thanks
Scott
CDIntf EnablePre event
I'm trying to listen for the EnabledPre event by using EVENTHANDLER in VFP. I can't seem to be able to bind to the event though.
In my application init I'm creating up two global objects oAPDF (this is an instance of CDINTFEX.CDINTFEX) and oMyPDFWriter (an instance of the class def below).
I then try to bind to the event to my event handler object with the command below, but it always returns false like it is failing to bind.
llReturn = EVENTHANDLER(oAPdf, oMyPDFWriter, .T.)
(note llReturn is always false after the call)
Stepping through my code at the time of the EVENTHANDLER call both my variables are pointing to valid objects so both my classes are initialized, etc.
I then try to print through the application and the messagebox call in my event handler indeed isn't firing. Any idea why this doesn't seem to be binding up? The VFP help shows an example where my event hanlder class uses an interface, but i wouldn't think this should be nessecary.
DEFINE CLASS MyPDFWriter As Custom
PROCEDURE EnabledPre
MESSAGEBOX("In EnabledPre")
oAPdf.EnablePrinter("xxx", "xxx")
ENDPROC
ENDDEFINE
In my application init I'm creating up two global objects oAPDF (this is an instance of CDINTFEX.CDINTFEX) and oMyPDFWriter (an instance of the class def below).
I then try to bind to the event to my event handler object with the command below, but it always returns false like it is failing to bind.
llReturn = EVENTHANDLER(oAPdf, oMyPDFWriter, .T.)
(note llReturn is always false after the call)
Stepping through my code at the time of the EVENTHANDLER call both my variables are pointing to valid objects so both my classes are initialized, etc.
I then try to print through the application and the messagebox call in my event handler indeed isn't firing. Any idea why this doesn't seem to be binding up? The VFP help shows an example where my event hanlder class uses an interface, but i wouldn't think this should be nessecary.
DEFINE CLASS MyPDFWriter As Custom
PROCEDURE EnabledPre
MESSAGEBOX("In EnabledPre")
oAPdf.EnablePrinter("xxx", "xxx")
ENDPROC
ENDDEFINE
Hello,
Are you turning BroadCast messages ON ?
Are you turning BroadCast messages ON ?
Custom Brand the Amyuni PDF Printer Driver http://www.amyuni.com/en/developer/branding/index.html
Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark
Amyuni PDF Converter tested for true PDF performance. View results - http://www.amyuni.com/benchmark