require 'mscorlib' include System include System::Reflection include System::Runtime::InteropServices objType = System::Type.GetTypeFromProgID("Shell.Application") shell = System::Activator.CreateInstance(objType) hwnd = 0 title = "Hello, COM(IronRuby) World!".to_clr_string option = 0 rootFolder = 36 params = System::Array[System::Object].new [hwnd, title, option, rootFolder] folder = shell.GetType().InvokeMember( "BrowseForFolder", BindingFlags.InvokeMethod, nil, shell, params ) if folder != nil then System::Runtime::InteropServices::Marshal.ReleaseComObject(folder) end System::Runtime::InteropServices::Marshal.ReleaseComObject(shell)