Hi:
My name is Dan Grollman, I'm at yale University working with John
Peterson and Paul Hudak on a coordinated motion project. Were working
with a few robots, and trying to get them to run from Haskell. The robots
came with an OCX, so we used HaskellDirect to attempt to get the OCX into
Haskell.
The first problem we ran into was this message:
C:\HaskellDirect\0.16>ihc --fcom --hugs --tlb CyeCom.ocx -o CyeCom.hs
Unrecognised option: --fcom, ignoring.
Unknown Option Flag '/tmp/ihc0*'
USAGE: rm [-i] [-a] [-f] [-r] file_or_directory_name(s)
-i Inquire before delete mode (default no)
-a Inquire before deleting non-archived files
-f Remove without prompting or complaining
-r Recursively delete directory structures
C:\HaskellDirect\0.16>
But HaskellDirect appeared to have worked anyway, as the CyeCom.hs file
was created.
So, following the directions on the manual on your website, we wrote a
simple program to create an instance of our object and do a few simple
things with it:
module CTest2 where
import CyeCom
import Com
main = coRun $ do
bob <- coCreateInstance
clsidCyeCom
Nothing
AnyProcess
iidDCyeCom
putStrLn "Created"
bob # setRobotAddress 1
putStrLn "Address Set"
powerDown bob
putStrLn "Power Down"
return()
Now, the first part works fine, "bob" is created and the string "created
is printed. But then, during setRobotAddress, hugs generated an error
window saying "invoke failed". When "OK" is pushed, another message
"(0x8000ffff) Unexpected failure (-2147418113)" appears, and then
User error: Com error: (0x8000ffff) Unexpected failure
(-2147418113)
CTest2>
appears on the screen.
We're not sure what's going on, but as the code looks right, we thought
maybe we're using HDirect wrong or something. Any ideas as to how to make
this work?
Thanks for your time,
Dan Grollman