Yes, my experiments were done on Win2K.

Here is the documentation of the "problem" (from the documentation for the OPENFILENAME structure that is passed to the GetOpenFileName function):

lpstrInitialDir (a field in that structure)

Pointer to a string that specifies the initial file directory.

Windows NT 5.0 and later; Windows 98 and later:

If lpstrInitalDir is NULL and the current directory contains any files of the specified filter types, the initial directory is the current directory.

If lpstrInitalDir is NULL and the current directory does not contain any files of the specified filter types, the initial directory is the personal files directory of the current user. To specify the current user's personal files directory as the initial directory, set lpstrInitialDir to the path returned by calling theSHGetSpecialFolderLocation function with the CSIDL_PERSONAL flag.

Earlier versions of Windows and Windows NT:

If lpstrInitalDir is NULL, the initial directory is the current directory.

So I was close. The problem isn't with directories named "tmp", it is with directories that don't contain any files of the type you requested to be opened.

The documentation implies that if you change this value to not be NULL, then things will work as you desire. Checking the source code for Tk (download Tk800_023_tar.gz from CPAN, extract files, find call to GetOpenFileName in Tk800.023\pTk\mTk\win\tkWinDialog.c, etc.) I see that specifying the -initialdir option should take care of that. Of course, you said that you already tried that. ):

Perhaps you should experiment some more on exactly how you pass the -initialdir in. I know, for example, that file dialogues are one of the few places in Win32 that you can't type forward slash (/) as a directory separator. Perhaps the -initialdir also requires that only back slashes (\) be used?

        - tye (but my friends call me "Tye")

In reply to (tye)Re2: chdir does not work on win2000 by tye
in thread chdir does not work on win2000 by juo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.