Search code examples
cwinapicommingwopenfiledialog

Common Item Dialog interfaces not included in minGW?


I'm writing a program for Windows 10 in C using MinGW. I have the latest version. I want to display an open file dialog, which is easy to do with GetOpenFileName. However in the documentation it says that this approach has been superseded by the Common Item Dialog, and they recommend using that approach instead which among other things uses an interface called IFileDialog and some other similarly named ones. The problem is none of these types seem to be defined anywhere. I've tried including shobjidl.h, I've tried looking inside a few header files that I thought might've had it, I've tried searching for solutions online, and I've even tried searching for the string "IFileDialog" in all the files inside my MinGW installation folder, but nothing turned up and it still won't compile due to an unknown type name.

The easy solution is to just use the old way with GetOpenFileName, but I kinda want to figure this out. Any ideas?


Solution

  • You must be using an old version of MinGW.

    MinGW-w64 is much more up to date than MinGW, and there it is defined in shobjidl.h.

    Try using the latest personal build of MinGW-w64 from http://winlibs.com/