¡Feliz Navidad para los compañeros del foro!
Les dejo la clase OleWithEvent, que le añade control de eventos a los ActiveX.
El primer ejemplo es con Harbour, sin FW, y muestra como se usa con ADO.
http://www.ziddu.com/download/5958441/O ... 1.zip.html
El segundo ejemplo usa FW, de hecho es el programa TestxBrw2 del directorio samples, modificado para que use ADO y muestre eventos.
http://www.ziddu.com/download/5958440/O ... 2.zip.html
Ambos son proyectos de xMate, tal vez tengas que ajustar el entorno para recompilarlos, pero los exes estan incluidos para probarlo.
Aun falta mejorarla, ya que no reconoce aun los eventos por nombre sino por el ID, pero con lo que hay se puede usar.
Espero sea de utilidad.
(*) He cambiado el alojamiento de los ficheros
Ole With Events
-
- Posts: 988
- Joined: Thu Nov 24, 2005 3:01 pm
- Location: Madrid, España
Ole With Events
Last edited by Carlos Mora on Mon Aug 17, 2009 7:58 am, edited 1 time in total.
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Biel EA6DD
- Posts: 680
- Joined: Tue Feb 14, 2006 9:48 am
- Location: Mallorca
- Contact:
Re: Ole With Events
Buen trabajo Carlos, gracias.
-
- Posts: 52
- Joined: Thu Mar 22, 2012 5:43 pm
- Location: USA
To: FW/Antonio Linares (Topic: Ole With Events)
Dear Antonio,
I'm looking ways to handle events of Ole. I used CreateObject(programID) to create the object. I can use methods and properties but I can't figure to received events. I am not very good in Spanish.
My question is how can I handle events of objects created by function CreateObject(programID). I am already using the object in my app but I need to receive and handle fired events.
Thank you very much.
Jose
I'm looking ways to handle events of Ole. I used CreateObject(programID) to create the object. I can use methods and properties but I can't figure to received events. I am not very good in Spanish.
My question is how can I handle events of objects created by function CreateObject(programID). I am already using the object in my app but I need to receive and handle fired events.
Thank you very much.
Jose
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Ole With Events
Jose,
FWH implements a function ActXEvents() (called from Class THActiveX METHOD ReadTypes), that read all the events names that the OLE object uses:
::aEvents = ActXEvents( cTypeLib, ::oOleAuto:__hObj )
Please review FWH\source\classes\activex.prg. Both Classes TActiveX (the first one implemented in FWH) and THActiveX are in that file.
PROCEDURE Event( ... ) CLASS THActiveX is the method that routes the events
FWH implements a function ActXEvents() (called from Class THActiveX METHOD ReadTypes), that read all the events names that the OLE object uses:
::aEvents = ActXEvents( cTypeLib, ::oOleAuto:__hObj )
Please review FWH\source\classes\activex.prg. Both Classes TActiveX (the first one implemented in FWH) and THActiveX are in that file.
PROCEDURE Event( ... ) CLASS THActiveX is the method that routes the events