[racket] Bug. ffi/com + MSScriptControl.ScriptContr ol

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Mar 28 17:14:27 EDT 2014

Thanks for the report! I've pushed a repair to `ffi/com` boolean
handling. (The VT_BOOL representation as 16 bits is surprising.)

At Sun, 23 Mar 2014 18:51:44 +0400, Roman Klochkov wrote:
>  #lang racket
> (require ffi/com)
> (displayln 
>  (let ([com (com-create-instance "MSScriptControl.ScriptControl")])
>    (com-set-property! com "Language" "VBScript")
>    (com-invoke com "AddCode" "Function Test1() \n Test1=false \n End Function")
>    (com-invoke (com-get-property com "CodeObject") "Test1")))
> (displayln 
>  (let ([com (com-create-instance "MSScriptControl.ScriptControl")])
>    (com-set-property! com "Language" "VBScript")
>    (com-invoke com "AddCode" "Function Test(x) \n Test=(x>2) \n End Function")
>    (com-invoke (com-get-property com "CodeObject") "Test" 1)))
> (displayln 
>  (let ([com (com-create-instance "MSScriptControl.ScriptControl")])
>    (com-set-property! com "Language" "VBScript")
>    (com-invoke com "AddCode" "Function Test2() \n Test2=false \n End Function")
>    (com-invoke (com-get-property com "CodeObject") "Test2")))
> 
> -----
> 
> First run:
> #f
> #t
> #t
> 
> Second run (from the same DrRacket)
> #t
> #t
> #t
> 
> And no good results from booleans (always #t) until DrRacket reset.
> 
> Tested on WinXP SP3 x32.  Can someone test on another Windows?
> 
> -- 
> Roman Klochkov____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users


Posted on the users mailing list.