The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: BlackVortex on September 12, 2008, 06:12:16 PM

Title: GetOpenFileName changes my working dir ?
Post by: BlackVortex on September 12, 2008, 06:12:16 PM
I was having problems checking for the existence of a file, and then I realized that it was because of a GetOpenFileName call. How can I properly preserve my working dir after that function ? (without saving and restoring it)

Maybe something wrong in my OPENFILENAME Structure ? I will paste code if needed.
Title: Re: GetOpenFileName changes my working dir ?
Post by: [STN] on September 12, 2008, 06:27:25 PM
Hey,

Try using the OFN_NOCHANGEDIR flag ?.

QuoteOFN_NOCHANGEDIR   
Restores the current directory to its original value if the user changed the directory while searching for files.
Title: Re: GetOpenFileName changes my working dir ?
Post by: BlackVortex on September 12, 2008, 06:37:09 PM
Haha, thank you, I got lost in msdn and my brain is kinda fried after hours of coding      :thumbu