Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use EVENTHANDLER()
Message
De
14/07/2006 08:46:59
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01136166
Message ID:
01136355
Vues:
12
This message has been marked as a message which has helped to the initial question of the thread.
>Hi Everyone,
>It the first time I need to use the EVENTHANDLER() function. In my case I need to bind to AutoCAD event. What I am missing is how I can know what to write in the IMPLEMENTS command of my class.
>
>oACAD  = CREATEOBJECT("Autocad.Application")
>oEvents = NEWOBJECT("jrAcadEvents")
>
>? EVENTHANDLER(ox  , oEvents)
>oACAD.Documents.OPEN("C:\Intra9\ALINK\vide_m.dwg")
>WAIT WINDOW "Done!"
>
>DEFINE CLASS jrAcadEvents AS custom
>
>IMPLEMENTS Documents IN "c:\program files\common files\autodesk shared\acax16enu.tlb"
>
>	PROCEDURE Document_BeginOpen(FileName)
>	* Add user code here
>
>  Wait Window  nowait "Openning file:"+FileName
>	ENDPROC
>
>ENDDEFINE
>
>When I run this code I get this error:
>Program Error
>Class cannot be instantiated because Member 'DOCUMENTS_get_Visible' does not exist
>

When you implement an interface, you must include code for every method in that interface. The code can be empty, but it must be there.

The easiest way to do this is, as Hugh suggested, to drag the interface from the Object Browser into a PRG; then just fill in the methods you're interested in.

Tamar
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform