Monday, May 31, 2010

Hooray for the simplicity of C++

I've pretty much spent the entire night getting dialog boxes working all properly, unfortunately a small problem with Windows Dialog Boxes is that without setting a particular flag, they change the working directory, meaning anything you are loading relatively will fail.

Before:
opf.Flags = (OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT) & ~OFN_ALLOWMULTISELECT;


After:
opf.Flags = (OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_NOCHANGEDIR) & ~OFN_ALLOWMULTISELECT;


2 hours lost simply because I needed to write append the "OFN_NOCHANGEDIR" flag to the list.

No comments:

Post a Comment