Ole With Events

Ole With Events

Postby Carlos Mora » Wed Dec 24, 2008 3:41 pm

¡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/OleWithEvents1.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/OleWithEvents2.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"
Carlos Mora
 
Posts: 988
Joined: Thu Nov 24, 2005 3:01 pm
Location: Madrid, España

Postby Antonio Linares » Wed Dec 24, 2008 6:09 pm

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

Re: Ole With Events

Postby Biel EA6DD » Fri Jan 02, 2009 7:57 am

Buen trabajo Carlos, gracias.
User avatar
Biel EA6DD
 
Posts: 682
Joined: Tue Feb 14, 2006 9:48 am
Location: Mallorca

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

Postby Jose Dolar » Fri Jun 13, 2014 8:51 pm

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
Jose Dolar
 
Posts: 52
Joined: Thu Mar 22, 2012 5:43 pm
Location: USA

Re: Ole With Events

Postby Antonio Linares » Sat Jun 14, 2014 6:03 am

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


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], russimicro and 36 guests