Forum: IronRuby cannot initialize Form with IronRuby

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.
48d1aca7191f2d16e184971054c7c143?d=identicon&s=25 Meinrad Recheis (Guest)
on 2009-02-08 21:21
(Received via mailing list)
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
>>> 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
1e39a948a58f4569c53d971c2e120920?d=identicon&s=25 Ivan Porto carrero (casualjim)
on 2009-02-08 22:51
(Received via mailing list)
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 Recheis
68f1bd9e9a7d9d10f0278c6535f700fe?d=identicon&s=25 Michael Letterle (mletterle)
on 2009-02-08 23:00
(Received via mailing list)
try f.show_dialog

On Sun, Feb 8, 2009 at 1:54 PM, Meinrad Recheis
Cb51033949ffccd982ae32c9f890f25a?d=identicon&s=25 Tomas Matousek (Guest)
on 2009-02-08 23:55
(Received via mailing list)
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: ironruby-core-bounces@rubyforge.org
[mailto:ironruby-core-bounces@rubyforge.org] 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
48d1aca7191f2d16e184971054c7c143?d=identicon&s=25 Meinrad Recheis (Guest)
on 2009-02-09 00:41
(Received via mailing list)
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 Matousek
<Tomas.Matousek@microsoft.com
Cb51033949ffccd982ae32c9f890f25a?d=identicon&s=25 Tomas Matousek (Guest)
on 2009-02-09 01:17
(Received via mailing list)
I fixed this on Friday :)

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-...

Tomas

From: ironruby-core-bounces@rubyforge.org
[mailto:ironruby-core-bounces@rubyforge.org] On Behalf Of Meinrad
Recheis
Sent: Sunday, February 08, 2009 3:26 PM
To: ironruby-core@rubyforge.org
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 Matousek
<Tomas.Matousek@microsoft.com<mailto:Tomas.Matousek@microsoft.com>>
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:
ironruby-core-bounces@rubyforge.org<mailto:ironruby-core-bounces@rubyforge.org>
[mailto:ironruby-core-bounces@rubyforge.org<mailto:ironruby-core-bounces@rubyforge.org>]
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
48d1aca7191f2d16e184971054c7c143?d=identicon&s=25 Meinrad Recheis (Guest)
on 2009-02-09 01:42
(Received via mailing list)
On Mon, Feb 9, 2009 at 1:14 AM, Tomas Matousek
<Tomas.Matousek@microsoft.com
> 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-...
>
>
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<T>. How
can
that problem be resolved?

Error 23 The type 'System.Func<TResult>' exists in both 'd:\Program
Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll' and
'..\Microsoft.Scripting.Core.dll'
Cb51033949ffccd982ae32c9f890f25a?d=identicon&s=25 Tomas Matousek (Guest)
on 2009-02-09 03:46
(Received via mailing list)
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: ironruby-core-bounces@rubyforge.org
[mailto:ironruby-core-bounces@rubyforge.org] On Behalf Of Meinrad
Recheis
Sent: Sunday, February 08, 2009 4:42 PM
To: ironruby-core@rubyforge.org
Subject: Re: [Ironruby-core] cannot initialize Form with IronRuby

On Mon, Feb 9, 2009 at 1:14 AM, Tomas Matousek
<Tomas.Matousek@microsoft.com<mailto:Tomas.Matousek@microsoft.com>>
wrote:

I fixed this on Friday :)



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-...

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<T>.
How can that problem be resolved?
Error    23        The type 'System.Func<TResult>' exists in both
'd:\Program Files\Reference
Assemblies\Microsoft\Framework\v3.5\System.Core.dll' and
'..\Microsoft.Scripting.Core.dll'
This topic is locked and can not be replied to.