The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

rfalcon (1) [Avatar] Offline
#1
Hi:

I was trying the first few lines of code in listing 15.2

def player = new ActiveXProxy('WMPlayer.OCX')
player.events.PlayStateChange = { variants ->
if (variants[0].value == 1)
synchronized(player) { player.notify() }
}
player.events.listen()

when I ran into this error:

Caught: groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.scriptom.ActiveXObject$EventSupport.listen() is applicable for argument types: () values: []
Possible solutions: println(), use([Ljava.lang.Objectsmilie, println(java.lang.Object), println(java.io.PrintWriter), with(groovy.lang.Closure), is(java.lang.Object)
groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.scriptom.ActiveXObject$EventSupport.listen() is applicable for argument types: () values: []
Possible solutions: println(), use([Ljava.lang.Objectsmilie, println(java.lang.Object), println(java.io.PrintWriter), with(groovy.lang.Closure), is(java.lang.Object)
at testGroovyScriptom.MyTest.main(MyTest.groovy:65)


I am using Groovy 2.1.7, any ideas?
Mittie (397) [Avatar] Offline
#2
I guess you refer to the first edition of the book, not the second where this forum is about.

With ActiveX support, things can be brittle with regard to your windows version...
Those questions are typically best placed at stackoverflow.

keep groovin'
Dierk