Ole With Events

Post Reply
Carlos Mora
Posts: 988
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Ole With Events

Post by Carlos Mora »

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

Post by Antonio Linares »

Carlos,

Seria muy interesante si pudieses adaptar tus cambios a la Clase OLE propia de Harbour/xHarbour para que asi pueda incorporarse a los repositorios oficiales de Harbour/xHarbour.

Seguro que muchos usuarios de Harbour/xHarbour te lo agradeceran :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Biel EA6DD
Posts: 680
Joined: Tue Feb 14, 2006 9:48 am
Location: Mallorca
Contact:

Re: Ole With Events

Post by Biel EA6DD »

Buen trabajo Carlos, gracias.
Jose Dolar
Posts: 52
Joined: Thu Mar 22, 2012 5:43 pm
Location: USA

To: FW/Antonio Linares (Topic: Ole With Events)

Post by Jose Dolar »

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

Re: Ole With Events

Post by Antonio Linares »

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 :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply