> > OPENFILENAME ofn;
>
> ZeroMemory(&ofn, sizeof(ofn));
I second this advice; never forget it!
> > ofn.lStructSize = sizeof( OPENFILENAME_SIZE_VERSION_400 ); // =
>
> unless you're sure you're setting every field, you should probably get
> in the habit of doing that...
After reading on MSDN, I believe that OPENFILENAME_SIZE_VERSION_400
is a (constant) int. sizeof( int ) is 4. You probably want to drop
the "sizeof" in this piece of code.
Cheers,
/ h+
PS: if you had stepped through the offending data set-up in the
debugger, or just inspected it right before you called Windows,
you might have caught it more quickly.
|