From: "Damián M. González" Date: 2012-12-28T02:17:43+09:00 Subject: Re: "Open" dialog of Windows > Short answer: see http://www.ruby-forum.com/topic/168114 > > Long answer: > It would have been helpful to include the error message and the Windows > and > Ruby software versions you are using. See > http://www.catb.org/esr/faqs/smart-questions.html#beprecise > > Trying your example on Windows 7 Ruby 1.9.3 I get > Win32_Test.rb:3:in `initialize': unknown OLE server: > `MSComDlg.CommonDialog' (WIN32OLERuntimeError) Same OS and Ruby version. > This suggests that component is not installed on my machine. Even if it > was > installed, Google suggests there would be a Microsoft component > licensing > issue: > http://dutchgemini.wordpress.com/2010/12/23/vba-cannot-create-mscomdlg-commondialog-activex/ Same thing happen to me, I've been in that page. I've tried the solution but doesn't work for me, seems that the component is not installed on my machine. > If you insist on solving your problem by using native Windows dialogs, > an > alternative to an OLE component would be to access the Win32 API > directly: > http://www.ruby-doc.org/docs/ProgrammingRuby/html/win32.html#S3 > > See Win32 GetOpenFileName(): > http://msdn.microsoft.com/en-us/library/ms646927%28VS.85%29.aspx > http://msdn.microsoft.com/en-us/library/ms646829(v=vs.85).aspx#open_file > > GetOpenFileName() is deprecated but is probably easier to use than the > alternative. However, it will involve packing the OPENFILENAME members, > as > in the example I linked to at the start of my email. Well, this solution can be a mess, since I've scaped every time that I looked to the Win32API, it hurst me. Since that finally I have to appeal to construct the entire widget with FXRuby. > Feliz Navidad, > Kieran Thank you for taking the time to response. Feliz navidad y año nuevo! :) Damián. -- Posted via http://www.ruby-forum.com/.