Events from OLE

Jose Dolar
Posts: 52
Joined: Thu Mar 22, 2012 5:43 pm
Location: USA

Events from OLE

Post 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
Last edited by Jose Dolar on Fri Aug 08, 2014 2:57 pm, edited 1 time in total.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Events from OLE

Post by Antonio Linares »

Jose,

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

Antonio Linares
www.fivetechsoft.com
Jose Dolar
Posts: 52
Joined: Thu Mar 22, 2012 5:43 pm
Location: USA

Re: Events from OLE

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

Re: Events from OLE - More Info

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

Re: Events from OLE

Post by Antonio Linares »

Jose,

Please try it this way:

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

Antonio Linares
www.fivetechsoft.com
Jose Dolar
Posts: 52
Joined: Thu Mar 22, 2012 5:43 pm
Location: USA

Re: Events from OLE

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

Re: Events from OLE

Post by Antonio Linares »

Please try this:

MsgInfo( ::&cPropName:__hObj )

and let me know what you get
regards, saludos

Antonio Linares
www.fivetechsoft.com
Jose Dolar
Posts: 52
Joined: Thu Mar 22, 2012 5:43 pm
Location: USA

Re: Events from OLE

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

Re: Events from OLE

Post by Antonio Linares »

Jose,

Try this:

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

Antonio Linares
www.fivetechsoft.com
Jose Dolar
Posts: 52
Joined: Thu Mar 22, 2012 5:43 pm
Location: USA

Re: Events from OLE

Post by Jose Dolar »

Antonio,

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

FYI,

Jose
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Events from OLE

Post by Antonio Linares »

Jose,

This way:

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

Antonio Linares
www.fivetechsoft.com
Jose Dolar
Posts: 52
Joined: Thu Mar 22, 2012 5:43 pm
Location: USA

Re: Events from OLE

Post by Jose Dolar »

Antonio,

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

FYI,

Jose
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Events from OLE

Post 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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Events from OLE

Post by Antonio Linares »

Jose,

Please try this:

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

Antonio Linares
www.fivetechsoft.com
Jose Dolar
Posts: 52
Joined: Thu Mar 22, 2012 5:43 pm
Location: USA

Re: Events from OLE

Post 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
Post Reply