JavaEar 专注于收集分享传播有价值的技术资料

'BIF_RETURNONLYFSDIRS' : undeclared identifier

I am working on Win32 project in Visual studio 2012. It has file selection button using MFC Editbrowse Control. To write a code for this control, I have added afxeditbrowsectrl.h header file. When I build the solution, it gives me following error:

1>C:\Program Files (x86)\Microsoft Visual Studio 11.0\vc\atlmfc\include\afxeditbrowsectrl.h(67): error C2065: 'BIF_RETURNONLYFSDIRS' : undeclared identifier

My question is why this error occurs and how should I remove this error. Kindly guide me.

1个回答

    最佳答案
  1. Never add only those internal MFC header files. Always include afx.h or afxwin.h. Or if you do this. always make sure that you included afx.h or afxwin.h first.

    Otherwise you get Errors like this.

    Edit: And never include Windows.h before any MFC include. This will cause additional errors. If you use the MFC just include afx.h or afxwin.h first. Windows.h is included by the MFC include files.