Cannot initialize Form with IronRuby

IronRuby 1.0.0.0 on .NET 2.0.50727.1433
Copyright © Microsoft Corporation. All rights reserved.

require “System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyTo
ken=b77a5c561934e089”
=> true

Form = System::Windows::Forms::Form
=> System::Windows::Forms::Form

f=Form.new
=> #System::Windows::Forms::Form:0x000005c

f.Show()
:0: wrong number of arguments (2 for 3) (ArgumentError)

f.method( :Show).arity
=> 0

This is the latest daily DLR build on codeplex from 2009 Feb 1 at
9:36 PM. I read, that with older versions winforms interop has already
been
working.

– henon

I just compiled the ironruby version from github with rake and for me
the
following code works.

require “System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089”
Form = System::Windows::Forms::Form
f = Form.new
f.show

On Sun, Feb 8, 2009 at 7:54 PM, Meinrad R.

try f.show_dialog

On Sun, Feb 8, 2009 at 1:54 PM, Meinrad R.

On yesterdays checkout from git message “syncing to head of tfs” I get:

IronRuby 1.0.0.0 on .NET 2.0.50727.1433
Copyright © Microsoft Corporation. All rights reserved.

require “System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyTo
ken=b77a5c561934e089”
=> true

System::Windows::Forms::Form.new
=> #System::Windows::Forms::Form:0x000005c

f=System::Windows::Forms::Form.new
=> #System::Windows::Forms::Form:0x000005e

f.Show
:0: wrong number of arguments (2 for 3) (ArgumentError)

f.show
:0: wrong number of arguments (2 for 3) (ArgumentError)

f.show_dialog
=> #System::Windows::Forms::DialogResult:0x0000060

f.method(:Show).clr_members.each { |m| puts m.to_string }
Void Show(System.Windows.Forms.IWin32Window)
=> [#System::Reflection::RuntimeMethodInfo:0x0000062]

On recent git head it works like expected.

I will continue testing with the most recent sources. Keep up the great
work!
Cheers,
–henon

On Sun, Feb 8, 2009 at 9:58 PM, Tomas M.
<[email protected]

Works on the bits I have. Could you try following?

f.method(:Show).clr_members.each { |m| puts m.to_string }

It should print

Void Show()
Void Show(System.Windows.Forms.IWin32Window)

Tomas

From: [email protected]
[mailto:[email protected]] On Behalf Of Meinrad
Recheis
Sent: Sunday, February 08, 2009 10:55 AM
To: ironruby-core
Subject: [Ironruby-core] cannot initialize Form with IronRuby

IronRuby 1.0.0.0 on .NET 2.0.50727.1433
Copyright (c) Microsoft Corporation. All rights reserved.

require “System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”
=> true
Form = System::Windows::Forms::Form
=> System::Windows::Forms::Form
f=Form.new
=> #System::Windows::Forms::Form:0x000005c
f.Show()
:0: wrong number of arguments (2 for 3) (ArgumentError)

f.method( :Show).arity
=> 0

This is the latest daily DLR build on codeplex from 2009 Feb 1 at
9:36 PM. I read, that with older versions winforms interop has already
been working.

– henon

I fixed this on Friday :slight_smile:

The problem was that Show() declared on Control was hidden by
Show(IWin32Window) on Form. It took me a while to make it work :). See
http://rubyforge.org/pipermail/ironruby-core/2009-February/003752.html

Tomas

From: [email protected]
[mailto:[email protected]] On Behalf Of Meinrad
Recheis
Sent: Sunday, February 08, 2009 3:26 PM
To: [email protected]
Subject: Re: [Ironruby-core] cannot initialize Form with IronRuby

On yesterdays checkout from git message “syncing to head of tfs” I get:

IronRuby 1.0.0.0 on .NET 2.0.50727.1433
Copyright (c) Microsoft Corporation. All rights reserved.

require “System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyTo
ken=b77a5c561934e089”
=> true
System::Windows::Forms::Form.new
=> #System::Windows::Forms::Form:0x000005c
f=System::Windows::Forms::Form.new
=> #System::Windows::Forms::Form:0x000005e
f.Show
:0: wrong number of arguments (2 for 3) (ArgumentError)

f.show
:0: wrong number of arguments (2 for 3) (ArgumentError)

f.show_dialog
=> #System::Windows::Forms::DialogResult:0x0000060
f.method(:Show).clr_members.each { |m| puts m.to_string }
Void Show(System.Windows.Forms.IWin32Window)
=> [#System::Reflection::RuntimeMethodInfo:0x0000062]

On recent git head it works like expected.

I will continue testing with the most recent sources. Keep up the great
work!
Cheers,
–henon

On Sun, Feb 8, 2009 at 9:58 PM, Tomas M.
<[email protected]mailto:[email protected]>
wrote:

Works on the bits I have. Could you try following?

f.method(:Show).clr_members.each { |m| puts m.to_string }

It should print

Void Show()

Void Show(System.Windows.Forms.IWin32Window)

Tomas

From:
[email protected]mailto:[email protected]
[mailto:[email protected]mailto:[email protected]]
On Behalf Of Meinrad R.
Sent: Sunday, February 08, 2009 10:55 AM
To: ironruby-core
Subject: [Ironruby-core] cannot initialize Form with IronRuby

IronRuby 1.0.0.0 on .NET 2.0.50727.1433

Copyright (c) Microsoft Corporation. All rights reserved.

require “System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”

=> true

Form = System::Windows::Forms::Form

=> System::Windows::Forms::Form

f=Form.new

=> #System::Windows::Forms::Form:0x000005c

f.Show()

:0: wrong number of arguments (2 for 3) (ArgumentError)

f.method( :Show).arity

=> 0

This is the latest daily DLR build on codeplex from 2009 Feb 1 at
9:36 PM. I read, that with older versions winforms interop has already
been working.

– henon

On Mon, Feb 9, 2009 at 1:14 AM, Tomas M.
<[email protected]

wrote:

I fixed this on Friday J

The problem was that Show() declared on Control was hidden by
Show(IWin32Window) on Form. It took me a while to make it work J. See
http://rubyforge.org/pipermail/ironruby-core/2009-February/003752.html

I see. I notice, that there is still heavy development going on. Sadly,
in
the latest head there are System.Action<T, … >and System.Func<T, …>
definitions in Microsoft.Scripting.Core.dll that clash with the same
definitions in System.Core.dll which I need because of Hashset. How
can
that problem be resolved?

Error 23 The type ‘System.Func’ exists in both ‘d:\Program
Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll’ and
‘…\Microsoft.Scripting.Core.dll’

You can define a global alias for System.Core.dll: right-click on the
reference in project, select properties, write “SysCore” to “Aliases”
field, add “extern alias SysCore;” on top of your C# source file and use
“SysCore::” prefix for System.Core namespaces. See also
http://devhawk.net/2008/10/21/The+Fifth+Assembly.aspx.

Tomas

From: [email protected]
[mailto:[email protected]] On Behalf Of Meinrad
Recheis
Sent: Sunday, February 08, 2009 4:42 PM
To: [email protected]
Subject: Re: [Ironruby-core] cannot initialize Form with IronRuby

On Mon, Feb 9, 2009 at 1:14 AM, Tomas M.
<[email protected]mailto:[email protected]>
wrote:

I fixed this on Friday :slight_smile:

The problem was that Show() declared on Control was hidden by
Show(IWin32Window) on Form. It took me a while to make it work :). See
http://rubyforge.org/pipermail/ironruby-core/2009-February/003752.html

I see. I notice, that there is still heavy development going on. Sadly,
in the latest head there are System.Action<T, … >and System.Func<T,
…> definitions in Microsoft.Scripting.Core.dll that clash with the
same definitions in System.Core.dll which I need because of Hashset.
How can that problem be resolved?
Error 23 The type ‘System.Func’ exists in both
‘d:\Program Files\Reference
Assemblies\Microsoft\Framework\v3.5\System.Core.dll’ and
‘…\Microsoft.Scripting.Core.dll’