From: Corey Lawson Date: 2005-07-02T06:13:16+09:00 Subject: Re: win32ole object creation failure calls to comdlg32.ocx only work thru vb/vba/etc. comdlg32.dll is avail to all (but, as you can see, a PITA to use). Comdlg32.ocx is a nice wrapper on the dialog functions in comdlg32.dll. A very kludgy way around it, of course, would be to call comdlg32.ocx via VBScript, which you invoke via WIN32OLE, but then you would be able to pretty much paste all the VB/VBA code in verbatum... The one reference for the TextPrintDlg for Ruby actually works, at least for showing the dialog. But one thing that that dialog does not require that GetOpenFileis an hWnd (you should be able to use 0) or hInstance (what to use for irb, or do you try to get and use the shell's hInstance?). On 6/30/05, Axel wrote: > gregarican schrieb: > > Googling around for this Windows API entry it appears as if it > > should be referenced directly using VB and isn't readily available > > through scripting means. At least this URL makes it seem as such --> > > http://www.autoitscript.com/forum/index.php?s=58aec18875ef9a11f9d1b2af990a92c2&showtopic=11379&pid=80340&st=0&#entry80340. > > As the code in my earlier post comes from a book I thought it must have > worked at one point in time (authors test their stuff, don't they?). > But the above URL contains a telling phrase: "It will only be free if > you have an Application or some MS-Developer tools, like VBE on your > computer." This component seems to be available for scripting only if > certain MS products are installed. These might be MS Office or the > Visual Basic. Interesting. (MS VC++ does not help ... I have that on my > machine.) This may catch you when deploying your script to other > computers. > > But I think the approach of going through the API will work, as that is > available everywhere. It will be fun figuring out the correct pack > statement for the OFNFILENAME structure, but I expect it can be done ... > > >