[HDirect] ihc and COM

Fernand Lacas quarantedeux42 at yahoo.fr
Wed Mar 7 13:37:36 EST 2007


I'm continuing to experiment with HDirect and the ihc compiler. Trying the "huge" type libraries from Office applications (Word, Excel...), I've met the following issue: some Haskell stubs do not compile out of the box, essentially because of type mismatch between the type signature generated by the ihc compiler and the stub's code. 
For instance:

> Excel.hs:32:25:
No instance for (Automation.Variant a0)
arising from use of `Automation.outVariant' at Excel.hs:32:25-45
Possible fix:
add (Automation.Variant a0)
to the type signature(s) for `global_getActiveCell'

The faulty declaration is indeed :
  global_getActiveCell :: Global a1 -> Prelude.IO a0
  global_getActiveCell = Automation.propertyGet "ActiveCell" [] Automation.outVariant

whereas the correct type is (Automation.Variant a0) => Global a1 -> Prelude.IO a0

There are also some cases where there is a type mismatch between "Int64" and "Automation.Date" type, but the essence of the error is the same : the type signature does not 
 match the method's stub's code.

I've looked for an option in the compiler that would help (for instance, I suppose that removing all type signatures from the haskell file would allow to compile it), but I haven't found one.

NB : the ihc command line was "../src/ihc.exe --tlb -fautomation -fprefix-interface-name -fmaybe-optional-params -v  XL5EN32.OLB
(where the OLB file is Excel's type library).

Did anyone experienced similar issue ?

Thanks in advance,


PS: the COM library (without Automation) works well.


Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20070307/b4f99de7/attachment.htm

More information about the Glasgow-haskell-users mailing list