The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Grincheux on March 28, 2012, 06:33:06 AM

Title: IFileDialog
Post by: Grincheux on March 28, 2012, 06:33:06 AM
I have Windows 7 on my pc.
I read that the GetOpenFileName was repaced by the IFileDialog interface.

How can I use it ?
I need some example.

Thanks
Title: Re: IFileDialog
Post by: donkey on March 29, 2012, 06:15:59 PM
GetOpenFilename is still available and will not be deprecated since older software uses it exclusively. For IFileDialog you generally do not call it directly, it is implemented by IFileOpenDialog and IFileSaveDialog which are the two interfaces you would normally call. There is also an event sink that allows you to process events during the lifespan of the dialog, IFileDialogEvents. You can customize the file dialog using IFileDialogCustomize.

This is not a lightweight COM interface, it requires setting up a static COM server to handle events so it's not really something for anyone without COM experience unless you want just the bare bones implementation.
Title: Re: IFileDialog
Post by: Grincheux on March 30, 2012, 09:49:30 AM
Thanks for the answer, I asked about this because I have problems using GetOpenfilename with ml64 (invalid structure size !).
Title: Re: IFileDialog
Post by: donkey on March 30, 2012, 10:25:38 AM
In x64 the structure should be 152 bytes.
Title: Re: IFileDialog
Post by: Grincheux on March 30, 2012, 03:34:23 PM
I will check the structure alignment.

Thanks.