Forum: Ruby RubyCLR - passing in a parameter of UInt16

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
bvanderw (Guest)
on 2007-01-16 23:20
(Received via mailing list)
I am trying to use RubyCLR to access an existing .NET assembly. When I
try to call a method that takes a UInt16 (a C# ushort) parameter, I get
a missing_method error, presumably from RubyCLR, because it can't match
the parameter signature. (FWIW, this particular method is overloaded.)

I've tried everything I know to try to work around this, but I am
stumped. How can I explicitly force a parameter of UInt16 (or Byte,
etc.)??

--Bruce
Justin B. (Guest)
on 2007-01-17 00:12
(Received via mailing list)
On 1/16/07, bvanderw <removed_email_address@domain.invalid> wrote:
> I've tried everything I know to try to work around this, but I am
> stumped. How can I explicitly force a parameter of UInt16 (or Byte,
> etc.)??

It's a bit of a hack, but I'd just use the System.Convert method that
.NET already provides. You should be able to call it from Ruby and
pass the value returned to your assembly.

Justin
bvanderw (Guest)
on 2007-01-17 04:05
(Received via mailing list)
Justin - that's one of the things I tried, and it doesn't appear to
work. Thanks anyway!
This topic is locked and can not be replied to.