Writing a COM client in Haskell
This is most likely GHC specific. I am currently using GHC 6.8.3 and any other version may not work.
It should be obvious that we need FFI to make C calls to Windows COM components. I also use Krasimir Angelov's hscom package. Hscom implements the machinery needed to work with COM components.
It should be noted here that another subtle requirement is GHC extensions needed to make this all work. I had a tough time getting around a compilation problem. Krasimir, who is the author of hscom, graciously helped me with that problem. You can read the exact issue at http://www.nabble.com/Unboxing-VT_VARIANT-in-hscom-td19044443.html#a19044443. The short summary is that you need to enable GHC extensions with the switch -fglasgow-exts .
GHC package names seem to have changed over time. I spent a few hours chasing why import Process was failing. Well, it is now import System.Process.
In my next blog, I will show a minimal COM client written in Haskell.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment