Sesertin
Sesertin

Reputation: 462

MSDN open dialog box sample code

So I'm trying to run and compile this piece of sample code from MSDN (opening a dialig box): http://msdn.microsoft.com/en-us/library/ff485843(v=vs.85).aspx

My compiler gives an error: main.cpp: In function 'int wWinMain(HINSTANCE, HINSTANCE, LPWSTR, int)': main.cpp:19:9: error: 'IFileOpenDialog' was not declared in this scope

What I get from the documentation is that CoInitializeEx function should link against the necessary COM libraries and import the needed functions. Though I am totally new to C++ and Windows and for sure I'm getting something wrong.

I use Netbeans, MinGW and MSYS.

Can somebody help me out what is happening here and how to solve?

Upvotes: 1

Views: 843

Answers (1)

Cheers and hth. - Alf
Cheers and hth. - Alf

Reputation: 145269

MinGW g++ as of version 4.8.2 (the one I have) does not yet support Windows API functions or interfaces that were introduced in Windows Vista or later.

As a workaround you can use the old GetOpenFileName or GetSaveFileName dialog.

Alternatively download and install Visual Studio Express for Windows Desktop, and use Visual C++.

Upvotes: 1

Related Questions