[racket] How to use com-register-event-callback? ("to-ctype internal error" in speech recognition application)

From: Cesar Crusius (cesar.crusius at gmail.com)
Date: Fri Oct 3 19:48:16 EDT 2014

Hi all,

I am trying to interface to the Windows speech recognition libraries
(SAPI5) using Racket and ffi/com. I can connect to the service and receive
events, but as soon as an event comes I get

to-ctype: internal error: unknown type COM-0xe
  context...:
   C:\Program Files (x86)\Racket\collects\ffi\unsafe\com.rkt:1909:0:
variant-to-scheme159
   C:\Program Files (x86)\Racket\collects\ffi\unsafe\com.rkt:2175:0:
sink-variant-to-scheme

The event has been registered with

(let ((executor (com-make-event-executor)))
  (com-register-event-callback sapi5-recognizer-context "Recognition"
   (lambda (streamno streampos type result)
     (fprintf (current-output-port) "Recognized:~n"))
   executor)
  (com-register-event-callback sapi5-recognizer-context "PhraseStart"
   (lambda (streamno streampos)
     (fprintf (current-output-port) "Started:~n"))
   executor))

No matter what I do I get the same error. Any clues on how to solve this?

Thanks,

- Cesar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20141003/9a311de8/attachment.html>

Posted on the users mailing list.