Hi,

I am trying to write some Haskell application using COM.
One application is controling the LEGO robot.

The robot works fine when I code my program using VB.

However, when I use Haskell, there is an error: "invoke fail", "invalid
number of parameters".
Because my Haskell program can be compile correctly => correct number of
parameters. So ???

Have you ever got this trouble before? If you have, would you please tell me
is there any way to fix it?

Thank you very much for you help,
Phan Dung.

PS: This is the command line I use to create the files & my program:
ihc -fcom --tlb --hugs C:\PROGRA~1\LEGOMI~1\System\Spirit.ocx -o
NewSpirit.hs


import NewSpirit

import Prelude
import Com
import Int(Int16)
import IO
import Monad


main = coRun $
       do { server <- coCreateInstance clsidSpirit Nothing AnyProcess
iidDSpirit  
             ;  server # setLinkType  InfraRed
             ;  server # setPBrick  RCX
             ;  server # setComPortNo COM1   
                   
             -- ; print("debug1")
             -- ;  server # beginOfTask 1 
             -- ; print b
                  -- ;putStrLn (show a)
             ;  server # initComm  
             --; print("debug3")
             --; return ()
             --; server # endOfTask 
             --; server # poll 0 0
              }

Reply via email to