MSDN open dialog box sample code

ぃ、小莉子 提交于 2021-02-08 09:34:07

问题


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?


回答1:


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++.



来源:https://stackoverflow.com/questions/24173443/msdn-open-dialog-box-sample-code

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!