From: ab` on
Can't say I've tried ::SetCurrentDirectory before calling a
CFileDialog::DoModal.

It seems like a silly idea, which doesn't mean it wouldn't work.

On 6/2/2010 12:07 AM, Goran wrote:
> 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: Tom Serface on
Yes, I've noticed that as well. It opens where it thinks you want to be
rather than where you told it to be on subsequent calls. The
SetCurrentDirectory() call is an interesting idea and certainly easy enough
to try.

Tom

"ab`" <ab(a)absent.com> wrote in message
news:#llLVehALHA.4400(a)TK2MSFTNGP05.phx.gbl...
> 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: Mihai N. on

> 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.

The OFN_NOCHANGEDIR flag might also help.
In fact, some small code sample would help even more :-)


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