FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Events from OLE
Posts: 52
Joined: Thu Mar 22, 2012 05:43 PM
Events from OLE
Posted: Thu Aug 07, 2014 02:25 PM

Dear Antonio,

I wish you can take a look the "Event from OLE" Issue in my application.

The upgrade resolved the runtime error but I cannot still receive call backs (events) from OLE.

My understanding that the code block will be evaluated every time the OLE fired an event.

The code to register the handler is in LS_OPOS.PRG line 196.

                     __axRegisterHandler( ::&cPropName:__hObj, {| ...| MsgInfo( 'Test') },'{B196B284-BAB4-101A-B69C-00AA00341D07}')

If you need the OLE, you can find it in this link http://monroecs.com/opos.htm

Please advice. Thank you.

Regards/Saludos

Jose

Related topic: viewtopic.php?f=3&t=28657&start=30

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Events from OLE
Posted: Thu Aug 07, 2014 07:00 PM

Jose,

How are you creating the OLE object ? Please show me the code, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 52
Joined: Thu Mar 22, 2012 05:43 PM
Re: Events from OLE
Posted: Thu Aug 07, 2014 08:20 PM
Antonio,

I created the OLE for OPOS object using the function CreateObject as shown in the following.

oOle:=CreateObject(cProgID) && <-- Create OLE here

Source file: LS_OPOS.prg, line # 227

Let me know if you need more info.

Thank you,

Jose
Code (fw): Select all Collapse
**************************************************
Method Instantiate_Device(cProgID) class OPOSHardwareInterface
local oOle:='',n
local ciid:='{B196B284-BAB4-101A-B69C-00AA00341D07}'  && <-- IconnectionPointContainer
::lDeviceInstantiated:=.f.
oOle:=CreateObject(cProgID)   && <-- Create OLE here
if valtype(oOle)='O'
    ::lDeviceInstantiated:=.t.
    aadd(::aoDevices,oOle)
endif
return oOle
Posts: 52
Joined: Thu Mar 22, 2012 05:43 PM
Re: Events from OLE - More Info
Posted: Sun Aug 10, 2014 02:43 PM

Dear Antonio,

Just an additional information.

My application is using UnifiedPOS OLE CCO current verison 1.14.000, link http://monroecs.com/oposccos_current.htm (at the same web site).

Thank you,

Regards

Jose

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Events from OLE
Posted: Sun Aug 10, 2014 09:57 PM

Jose,

Please try it this way:

__axRegisterHandler( ::&cPropName:__hObj, {| ...| MsgInfo( 'Test') } )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 52
Joined: Thu Mar 22, 2012 05:43 PM
Re: Events from OLE
Posted: Sun Aug 10, 2014 11:31 PM

Antonio,

I just tried the following suggestion and it doesn't work. :(
__axRegisterHandler( ::&cPropName:__hObj, {| ...| MsgInfo( 'Test') } )

Please advise. Thank you.

Regards,

Jose

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Events from OLE
Posted: Mon Aug 11, 2014 02:42 AM

Please try this:

MsgInfo( ::&cPropName:__hObj )

and let me know what you get

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 52
Joined: Thu Mar 22, 2012 05:43 PM
Re: Events from OLE
Posted: Mon Aug 11, 2014 03:08 AM

Antonio,

I also checked valtype and here are results.

Msginfo(::&cPropName:__hObj) shows "ValtoChar not supported Type yet"

Msginfo(valtype(::&cPropName:__hObj)) shows "P"

FYI,

Jose

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Events from OLE
Posted: Mon Aug 11, 2014 04:17 AM

Jose,

Try this:

MsgInfo( __axRegisterHandler( ::&cPropName:__hObj, {| ...| MsgInfo( 'Test') } ) )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 52
Joined: Thu Mar 22, 2012 05:43 PM
Re: Events from OLE
Posted: Mon Aug 11, 2014 11:40 AM

Antonio,

MsgInfo( __axRegisterHandler( ::&cPropName:__hObj, {| ...| MsgInfo( 'Test') } ) ) shows "ValtoChar not supported Type yet"

FYI,

Jose

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Events from OLE
Posted: Mon Aug 11, 2014 01:09 PM

Jose,

This way:

MsgInfo( ValType( __axRegisterHandler( ::&cPropName:__hObj, {| ...| MsgInfo( 'Test') } ) ) )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 52
Joined: Thu Mar 22, 2012 05:43 PM
Re: Events from OLE
Posted: Mon Aug 11, 2014 02:33 PM

Antonio,

MsgInfo( ValType( __axRegisterHandler( ::&cPropName:__hObj, {| ...| MsgInfo( 'Test') } ) ) ) shows "P"

FYI,

Jose

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Events from OLE
Posted: Mon Aug 11, 2014 03:07 PM

Jose,

Then it means that there is little that we can do. Everything seems ok.

Thats the problem with OLE and third party tools: Your code is fine and it should work fine.

Anyhow, that code belongs to Harbour. It is not FWH code. I suggest you to ask about it in the Harbour developers list. Maybe there can provide some help.

Sorry about this, but trust me, there is little else that I may do to help you.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Events from OLE
Posted: Thu Aug 14, 2014 11:31 AM

Jose,

Please try this:

__axRegisterHandler( ::&cPropName:__hObj, { || MsgBeep() } )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 52
Joined: Thu Mar 22, 2012 05:43 PM
Re: Events from OLE
Posted: Thu Aug 14, 2014 09:16 PM

Antonio,

No sounds, message box or whatever to indicate an event. I removed the cover of the printer that should trigger an event but nothing happened. The printer is working fine and there is no runtime error like in the older Harbour.

FYI,

Jose