Page 1 of 2

Events from OLE

Posted: Thu Aug 07, 2014 2:25 pm
by Jose Dolar
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: http://forums.fivetechsupport.com/viewt ... 7&start=30

Re: Events from OLE

Posted: Thu Aug 07, 2014 7:00 pm
by Antonio Linares
Jose,

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

Re: Events from OLE

Posted: Thu Aug 07, 2014 8:20 pm
by Jose Dolar
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: Select all

**************************************************
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
 

Re: Events from OLE - More Info

Posted: Sun Aug 10, 2014 2:43 pm
by Jose Dolar
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

Re: Events from OLE

Posted: Sun Aug 10, 2014 9:57 pm
by Antonio Linares
Jose,

Please try it this way:

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

Re: Events from OLE

Posted: Sun Aug 10, 2014 11:31 pm
by Jose Dolar
Antonio,

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

Please advise. Thank you.

Regards,

Jose

Re: Events from OLE

Posted: Mon Aug 11, 2014 2:42 am
by Antonio Linares
Please try this:

MsgInfo( ::&cPropName:__hObj )

and let me know what you get

Re: Events from OLE

Posted: Mon Aug 11, 2014 3:08 am
by Jose Dolar
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

Re: Events from OLE

Posted: Mon Aug 11, 2014 4:17 am
by Antonio Linares
Jose,

Try this:

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

Re: Events from OLE

Posted: Mon Aug 11, 2014 11:40 am
by Jose Dolar
Antonio,

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

FYI,

Jose

Re: Events from OLE

Posted: Mon Aug 11, 2014 1:09 pm
by Antonio Linares
Jose,

This way:

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

Re: Events from OLE

Posted: Mon Aug 11, 2014 2:33 pm
by Jose Dolar
Antonio,

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

FYI,

Jose

Re: Events from OLE

Posted: Mon Aug 11, 2014 3:07 pm
by Antonio Linares
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.

Re: Events from OLE

Posted: Thu Aug 14, 2014 11:31 am
by Antonio Linares
Jose,

Please try this:

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

Re: Events from OLE

Posted: Thu Aug 14, 2014 9:16 pm
by Jose Dolar
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