
I am a Haskell newbie trying to do COM automation using Haskell. I am using
hscom (Krasimir's implementation of COM automation). I have run into a problem
and need some help.
I have a Variant returned from a COM method invocation. When I print it, it
shows up as below.
Variant VT_DISPATCH

This looks like a GHC bug to me. I am pretty sure that this worked before. Variant is defined like this: data Variant = forall a . Variant (VarType a) a data VarType a where .... VT_DISPATCH :: VarType (IDispatch ())
From this it clear that val is of type (IDispatch ()) because the VarType has value VT_DISPATCH. A workaround is to add explicit type singnature for val:
someFunc (Variant VT_DISPATCH val) query = do
dispId <- getMethodID "MethodName" (val :: IDispatch ())
I don't know why this doesn't work without the signature.
Regards,
Krasimir
On Tue, Aug 19, 2008 at 7:09 AM, Praki Prakash
I am a Haskell newbie trying to do COM automation using Haskell. I am using hscom (Krasimir's implementation of COM automation). I have run into a problem and need some help.
I have a Variant returned from a COM method invocation. When I print it, it shows up as below.
Variant VT_DISPATCH
I need to invoke methods on the wrapped interface. My attempt to unbox it as below runs into 'rigid type' error.
someFunc (Variant VT_DISPATCH val) query = do dispId <- getMethodID "MethodName" val
The code above generates this error.
Couldn't match expected type `IDispatch a' against inferred type `a1' `a1' is a rigid type variable bound by...
I am probably missing something pretty basic. Any help on this is greatly appreciated!
Thanks
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (2)
-
Krasimir Angelov
-
Praki Prakash