in reply to WIN32::OLE::VARIANT --- the destroyer of souls ???

You're showing us how you create $registerIndex, good.

Now is that what you're passing as nIndex? If so, we need to see what you're passing as nValue, which is the problem argument according to your error message.

You should be able to get this down to 5-20 lines of perl, initializing your system, setting up your 3 variants and then invoking ReadRegisterNoWrite. What happens in that case?
--
Mike

  • Comment on Re: WIN32::OLE::VARIANT --- the destroyer of souls ???

Replies are listed 'Best First'.
Re: Re: WIN32::OLE::VARIANT --- the destroyer of souls ???
by SleepingMonk (Novice) on Jul 16, 2003 at 15:17 UTC
    The error message should say "type mismatch......at arguement 2" sorry i copied it wrongly, but i use the same bit of code for all 3 variant variables.

    hope this helps

    cheers

    SleepingMonk

    p.s. would it be helpful if i gave you the entire code ?
      Probably not; I (happily) haven't had to fight OLE battles for a few years...

      I seem to recall that there's a DDESpy equivalent for OLE (or maybe you can use DDESpy to watch OLE traffic?). If so, you might be able to watch what a test VB application sends for that call, and then duplicate it yourself...

      My only other suggestion would be to use VT_UI1 instead of VT_I2, and see if that works, since you're only expecting one byte to be returned and not 2... That's based on a quick look at the docs, not any personal expertise with this module, I'm afraid.
      --
      Mike