Win32ole VT_ERROR question

I am trying to code an error code for an optional parameter list.

I am using windows-pr to get the DISP_E_PARAMNOTFOUND error

require 'windows/error'

error_code = Windows::Error::DISP_E_PARAMNOTFOUND

error = WIN32OLE_VARIANT.new( error_code, WIN32OLE::VARIANT::VT_ERROR)

I keep getting a failed to change type error

Type mismatch error

if I try it this way

error = WIN32OLE_VARIANT.new( nil, WIN32OLE::VARIANT::VT_ERROR)

error.value = error_code

I get the same error.

Is there anyway to get this error code setup? That is what .Net does with
the Type.Missing field for optional args that are empty

thanks in advance

Dominic Sisneros

Sorry for being too late to reply.

Unfortunately, there is no way to set error code.
But I have committed new version of win32ole into ruby-trunk.
The latest version of WIN32OLE (which comes up with
ruby 2.2.0-dev trunk 47431 or later) will support setting error code.
ie,
  WIN32OLE_VARIANT.new(-2147352572, WIN32OLE::VARIANT::VT_ERROR)
does not occur error.

And I added WIN32OLE_VARIANT::NoParam constant like as Type.Missing.

  Regards,
  Masaki Suketa

···

On Thu, Aug 21, 2014 at 02:59:03PM -0600, Dominic Sisneros wrote:

Is there anyway to get this error code setup? That is what .Net does with
the Type.Missing field for optional args that are empty

Wow, just saw this. I will rebuild my ruby to see if this cures my
problems. I will let you know as soon as I am able to try it out.

Thanks for all your hard work!

Dominic Sisneros

···

On Sat, Sep 6, 2014 at 2:11 AM, MasakiSuketa <masaki.suketa@nifty.ne.jp> wrote:

On Thu, Aug 21, 2014 at 02:59:03PM -0600, Dominic Sisneros wrote:
>
> Is there anyway to get this error code setup? That is what .Net does
with
> the Type.Missing field for optional args that are empty
>

Sorry for being too late to reply.

Unfortunately, there is no way to set error code.
But I have committed new version of win32ole into ruby-trunk.
The latest version of WIN32OLE (which comes up with
ruby 2.2.0-dev trunk 47431 or later) will support setting error code.
ie,
  WIN32OLE_VARIANT.new(-2147352572, WIN32OLE::VARIANT::VT_ERROR)
does not occur error.

And I added WIN32OLE_VARIANT::NoParam constant like as Type.Missing.

  Regards,
  Masaki Suketa