[Haskell-cafe] Unboxing VT_VARIANT in hscom

Praki Prakash praki.prakash at gmail.com
Tue Aug 19 01:09:57 EDT 2008


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 <interface 0x00039f00>

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







More information about the Haskell-Cafe mailing list