Hello, I can''t call the object''s method, thought it exists. My ruby script: - - - - - # Let''s dump .Net methods far.get_type.get_methods.each { |m| p m.name } # Try to call ''RegisterTool'' method begin far.register_tool rescue => err p err end begin far.RegisterTool rescue => err p err end - - - - - I get such output: - - - - - ... "RegisterFiler" "RegisterTool" ... #<NoMethodError: undefined method `register_tool'' for #<FarNet::Far:0x000005c>> #<NoMethodError: undefined method `RegisterTool'' for #<FarNet::Far:0x000005c>> - - - - - Not sure if this matters, but ''far'' variable is set by the script host scope.SetVariable("far", Far); Thanks, - Alex -- Posted via http://www.ruby-forum.com/.
Could you sent source code for FarNet class (RegisterTool method declaration)? Tomas -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Alex 2k8 Sent: Wednesday, January 07, 2009 5:25 PM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Problem calling CLR method Hello, I can''t call the object''s method, thought it exists. My ruby script: - - - - - # Let''s dump .Net methods far.get_type.get_methods.each { |m| p m.name } # Try to call ''RegisterTool'' method begin far.register_tool rescue => err p err end begin far.RegisterTool rescue => err p err end - - - - - I get such output: - - - - - ... "RegisterFiler" "RegisterTool" ... #<NoMethodError: undefined method `register_tool'' for #<FarNet::Far:0x000005c>> #<NoMethodError: undefined method `RegisterTool'' for #<FarNet::Far:0x000005c>> - - - - - Not sure if this matters, but ''far'' variable is set by the script host scope.SetVariable("far", Far); Thanks, - Alex -- Posted via http://www.ruby-forum.com/. _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
> Could you sent source code for FarNet class (RegisterTool method > declaration)?http://code.google.com/p/farnet/source/browse/trunk/FarNet/FarNetIntf/Far.cs http://code.google.com/p/farnet/source/browse/trunk/FarNet/FarNetPlugin/Far.h http://code.google.com/p/farnet/source/browse/trunk/FarNet/FarNetPlugin/Far.cpp Probably this is some how related to http://www.ruby-forum.com/topic/175168 ? -- Posted via http://www.ruby-forum.com/.
Btw, IronPython can call same method: http://farnet.googlecode.com/files/IronPythonFar.1.0.35.rar IronPythonFar\Scripts\calc.py - - - far.RegisterTool(ipy, "IronPython calculator", calc, FarManager.ToolOptions.F11Menus) - - - -- Posted via http://www.ruby-forum.com/.