On Fri, 21 Aug 2009, Alex Strickland wrote:
Hi,
> I'm sorry to not be more clear. To confirm your deductions, I have code like
> this:
> CLASS BPTI FROM HActiveX
> METHOD terminalDSPEvent(p1, p2, p3, p4) ;
> INLINE ::Event("terminalDSPEvent", p1, p2, p3, p4)
> METHOD infoEvent(p1, p2, p3, p4) ;
> INLINE ::Event("infoEvent", p1, p2, p3, p4)
> METHOD exceptionEvent(p1, p2, p3, p4) ;
> INLINE ::Event("exceptionEvent", p1, p2, p3, p4)
> METHOD Event()
> ...
> //
> // The event numbers are taken from the Type Library - ICoBpTiEvents
> //
> METHOD New(oWnd, cProgId, nTop, nLeft, nWidth, nHeight) CLASS BPTI
>
> ::EventMap(1, "terminalDSPEvent", self)
> ::EventMap(2, "infoEvent", self)
> ::EventMap(3, "exceptionEvent", self)
>
> return Super:New(oWnd, cProgId, nTop, nLeft, nWidth, nHeight)
> METHOD Event(cEvent, p2, p3, p4, p5) CLASS BPTI
> ...
> With Harbour I guess I would simpy have:
> METHOD Event(...) CLASS BPTI
In Harbour user event handler receives as 1-st parameter event number
and then ole parameters. So above functionality can be easy implemented
as:
oAx := WIN_AxGetControl( hWnd, ;
{|event,...| myEventHandler( obj, event, ... ) } )
function myEventHandler( obj, event, ... )
switch( event )
case 1:
return obj:terminalDSPEvent( ... )
case 2:
return obj:infoEvent( ... )
case 3:
return obj:exceptionEvent( ... )
endswitch
return NIL
best regards,
Przemek
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour