[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

RubyCLR - passing in a parameter of UInt16

Bruce

1/16/2007 9:16:00 PM

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

2 Answers

jgbailey

1/16/2007 10:13:00 PM

0

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

Bruce

1/17/2007 2:02:00 AM

0

Justin - that's one of the things I tried, and it doesn't appear to
work. Thanks anyway!

Justin Bailey wrote:
> 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.