Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#870 OLE events are not scheduled

None
open
nobody
None
none
5
2013-11-22
2010-01-03
Vladimir
No

OLE events are scheduled if mainline waits on infinite SysSleep.
OLE events are NOT scheduled if mainline waits on queue or SysWaitEventSem.
The problem was discussed also in HELP forum. Unfortunatelly, all samples use SysSleep that is not allowed for pure event driven applications.
Environment: oorexx 4.0 , Windows XP SP2
The sample with problem is below. It works with SysSleep. It doesn't work with SysWaitEventSem. To check the sample:
1) Install SysTray.ocx in any_dir
2) Register it: regsvr32 C:...\any_dir\SysTray.ocx
3) Change the sample with path to any small icon.
4) rexxpaws the sample
5) Point mouse to tray icon - you should see output on cmd console.
) Note. During close the cmd window on 'x' an error is appeared. Don't worry - it has nothing to oorexx.
--
trayOLE = .myClass~new("TrayPut.Tray","NOEVENTS")
trayOLE~connectEvents
if trayOLE~isConnected then say "OK"
trayOLE~SetTip = "Hello, World"
trayOLE~SetPicture = "C:...\xxx.ico"
trayOLE~Add
--
/

handle = SysCreateEventSem()
if handle = "" then exit 0
say "handle="handle
temp = SysWaitEventSem(handle)
if temp \= 0 then exit 0
*/
--
call SysSleep 1000
--
exit 0
--
::class myClass subclass OLEObject
::method MouseClick
use strict arg buttonType
say buttonType
return

Discussion

  • Vladimir
    Vladimir
    2010-01-03

    Sorry, forgot it: the ocx requires VB5 runtime dlls.

     


Anonymous


Cancel   Add attachments