Events from OLE

Events from OLE

Postby Jose Dolar » Thu Aug 07, 2014 2: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
Last edited by Jose Dolar on Fri Aug 08, 2014 2:57 pm, edited 1 time in total.
Jose Dolar
 
Posts: 52
Joined: Thu Mar 22, 2012 5:43 pm
Location: USA

Re: Events from OLE

Postby Antonio Linares » Thu Aug 07, 2014 7:00 pm

Jose,

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

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

Re: Events from OLE

Postby Jose Dolar » Thu Aug 07, 2014 8: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: Select all  Expand view

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

Postby Jose Dolar » Sun Aug 10, 2014 2: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
Jose Dolar
 
Posts: 52
Joined: Thu Mar 22, 2012 5:43 pm
Location: USA

Re: Events from OLE

Postby Antonio Linares » Sun Aug 10, 2014 9:57 pm

Jose,

Please try it this way:

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

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

Re: Events from OLE

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

Re: Events from OLE

Postby Antonio Linares » Mon Aug 11, 2014 2:42 am

Please try this:

MsgInfo( ::&cPropName:__hObj )

and let me know what you get
regards, saludos

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

Re: Events from OLE

Postby Jose Dolar » Mon Aug 11, 2014 3: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
Jose Dolar
 
Posts: 52
Joined: Thu Mar 22, 2012 5:43 pm
Location: USA

Re: Events from OLE

Postby Antonio Linares » Mon Aug 11, 2014 4:17 am

Jose,

Try this:

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

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

Re: Events from OLE

Postby Jose Dolar » Mon Aug 11, 2014 11:40 am

Antonio,

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

FYI,

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

Re: Events from OLE

Postby Antonio Linares » Mon Aug 11, 2014 1:09 pm

Jose,

This way:

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

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

Re: Events from OLE

Postby Jose Dolar » Mon Aug 11, 2014 2:33 pm

Antonio,

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

FYI,

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

Re: Events from OLE

Postby Antonio Linares » Mon Aug 11, 2014 3: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41315
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Events from OLE

Postby Antonio Linares » Thu Aug 14, 2014 11:31 am

Jose,

Please try this:

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

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

Re: Events from OLE

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

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], richard-service and 79 guests