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.
5c9aff292996a7adbb4839786020264c?d=identicon&s=25 bvanderw (Guest)
on 2007-01-16 22: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
573b9499030e1ccb867ef80f0ff1ac49?d=identicon&s=25 Justin Bailey (Guest)
on 2007-01-16 23:12
(Received via mailing list)
On 1/16/07, bvanderw <bvanderw@gmail.com> 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
5c9aff292996a7adbb4839786020264c?d=identicon&s=25 bvanderw (Guest)
on 2007-01-17 03: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.