Events from OLE
-
- Posts: 52
- Joined: Thu Mar 22, 2012 5:43 pm
- Location: USA
Events from OLE
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
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.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Events from OLE
Jose,
How are you creating the OLE object ? Please show me the code, thanks
How are you creating the OLE object ? Please show me the code, thanks
-
- Posts: 52
- Joined: Thu Mar 22, 2012 5:43 pm
- Location: USA
Re: Events from OLE
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
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
-
- Posts: 52
- Joined: Thu Mar 22, 2012 5:43 pm
- Location: USA
Re: Events from OLE - More Info
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
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
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Events from OLE
Jose,
Please try it this way:
__axRegisterHandler( ::&cPropName:__hObj, {| ...| MsgInfo( 'Test') } )
Please try it this way:
__axRegisterHandler( ::&cPropName:__hObj, {| ...| MsgInfo( 'Test') } )
-
- Posts: 52
- Joined: Thu Mar 22, 2012 5:43 pm
- Location: USA
Re: Events from OLE
Antonio,
I just tried the following suggestion and it doesn't work.
__axRegisterHandler( ::&cPropName:__hObj, {| ...| MsgInfo( 'Test') } )
Please advise. Thank you.
Regards,
Jose
I just tried the following suggestion and it doesn't work.
__axRegisterHandler( ::&cPropName:__hObj, {| ...| MsgInfo( 'Test') } )
Please advise. Thank you.
Regards,
Jose
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Events from OLE
Please try this:
MsgInfo( ::&cPropName:__hObj )
and let me know what you get
MsgInfo( ::&cPropName:__hObj )
and let me know what you get
-
- Posts: 52
- Joined: Thu Mar 22, 2012 5:43 pm
- Location: USA
Re: Events from OLE
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
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
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Events from OLE
Jose,
Try this:
MsgInfo( __axRegisterHandler( ::&cPropName:__hObj, {| ...| MsgInfo( 'Test') } ) )
Try this:
MsgInfo( __axRegisterHandler( ::&cPropName:__hObj, {| ...| MsgInfo( 'Test') } ) )
-
- Posts: 52
- Joined: Thu Mar 22, 2012 5:43 pm
- Location: USA
Re: Events from OLE
Antonio,
MsgInfo( __axRegisterHandler( ::&cPropName:__hObj, {| ...| MsgInfo( 'Test') } ) ) shows "ValtoChar not supported Type yet"
FYI,
Jose
MsgInfo( __axRegisterHandler( ::&cPropName:__hObj, {| ...| MsgInfo( 'Test') } ) ) shows "ValtoChar not supported Type yet"
FYI,
Jose
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Events from OLE
Jose,
This way:
MsgInfo( ValType( __axRegisterHandler( ::&cPropName:__hObj, {| ...| MsgInfo( 'Test') } ) ) )
This way:
MsgInfo( ValType( __axRegisterHandler( ::&cPropName:__hObj, {| ...| MsgInfo( 'Test') } ) ) )
-
- Posts: 52
- Joined: Thu Mar 22, 2012 5:43 pm
- Location: USA
Re: Events from OLE
Antonio,
MsgInfo( ValType( __axRegisterHandler( ::&cPropName:__hObj, {| ...| MsgInfo( 'Test') } ) ) ) shows "P"
FYI,
Jose
MsgInfo( ValType( __axRegisterHandler( ::&cPropName:__hObj, {| ...| MsgInfo( 'Test') } ) ) ) shows "P"
FYI,
Jose
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Events from OLE
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.
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.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: Events from OLE
Jose,
Please try this:
__axRegisterHandler( ::&cPropName:__hObj, { || MsgBeep() } )
Please try this:
__axRegisterHandler( ::&cPropName:__hObj, { || MsgBeep() } )
-
- Posts: 52
- Joined: Thu Mar 22, 2012 5:43 pm
- Location: USA
Re: Events from OLE
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
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