Re: getOpenFileName()

new topic     » goto parent     » topic index » view thread      » older message » newer message

don cole wrote:
> 
> Greg Haberek wrote:
> > 
> > don cole wrote:
> > > 
> > > VOID=getOpenFileName()
> > > 
> > > Always open in folder "Documents".
> > > 
> > > How can I change this?
> > 
> > You can pass a path to "file" parameter of the function:
> > 
> > }}}
<eucode>
> > VOID = getOpenFileName( 0, "C:\\WINDOWS\\system32\\", {"All Files", "*.*"} )
> > </eucode>
{{{

> > 
> > You *MUST* end the path in a backslash, else Windows will fill in the last
> > part
> > as the filename to choose.
> > 
> > HTH,
> > 
> > -Greg
> 
> Thanks Greg and Mike777,
> 
>    Now a new problem had popped up.
> Here's my code:
> 
> }}}
<eucode>
>                           filename = getOpenFileName(
>                           MainWin,                  -- parent window
>                           "H:\\",                         -- no default name
>                           {"Dialog Flags", {OFN_ALLOWMULTISELECT},
>                             "Rar Files", "*.RAR" ,    -- rar files
>                             "All Files", "*.*" } )    -- everything else
> </eucode>
{{{

> It open in H: which is what I want but
> now all files show up in the openDialog box not just the .rar files?
> With my old code:
> }}}
<eucode>
> filename=getOpenFileName(0,"",   {"Dialog Flags", {OFN_ALLOWMULTISELECT},
>                             "Rar Files", "*.RAR" ,    -- rar files
>                             "All Files", "*.*" } )    -- everything else
> </eucode>
{{{

> 
> only the .rar files showed up.
> 
> Don Cole

This has been a "simplification", hence a problem, to the user interface so that
s/he has less parameters to care about. I don't know for how long it has been
there, but probably from D. Cuny's days.

v70.4 will have a getOpenFileNameEx() that will enable you to specify the
initial directory without using the file name field, as it should have been done
from day one. I cannot change the current behaviour as tons of code may rely on
it, hence a new routine.

I hope to ship out 70.4 for testing this weekend at the latest, for a release
somewhere in february, bar gaping bugs showing up.

CChris

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu