From: ab` on
just want my CFileDialog to start where I tell it, everytime...
From: Mihai N. on

> just want my CFileDialog to start where I tell it, everytime...

But are you telling it where you want? How?

You have to specify lpstrInitialDir in the m_ofn member.
There is some interaction with lpstrFile, read the lpstrInitialDir
description at
http://msdn.microsoft.com/en-us/library/ms646839%28VS.85%29.aspx


--
Mihai Nita [Microsoft MVP, Visual C++]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email

From: ab` on
Yes, it seems useless in Windows 7.

On 6/1/2010 10:47 PM, Mihai N. wrote:
>
>> just want my CFileDialog to start where I tell it, everytime...
>
> But are you telling it where you want? How?
>
> You have to specify lpstrInitialDir in the m_ofn member.
> There is some interaction with lpstrFile, read the lpstrInitialDir
> description at
> http://msdn.microsoft.com/en-us/library/ms646839%28VS.85%29.aspx
>
>

From: Goran on
On Jun 2, 6:58 am, ab` <a...(a)absent.com> wrote:
> just want my CFileDialog to start where I tell it, everytime...

That's related to your "working directory", not MRU. When your user
opens a file somewhere, working directory changes to there. Most
likely you have a bug in your code and you are not setting
m_ofn.lpstrInitialDir correctly.

Do you have your code working as expected in pre-7, but not in 7?

Goran.
From: David Lowndes on
>Yes, it seems useless in Windows 7.

Probably due to this intentional behaviour:

"1.If lpstrInitialDir has the same value as was passed the first time
the application used an Open or Save As dialog box, the path most
recently selected by the user is used as the initial directory."

Generally I find this behaviour benificial, but I guess in some
circumstances it won't be.

I don't know if you can circumvent this behaviour by the hook
facilities.

Dave