Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't Visual Studio 2008 locate afxcontrolbars.h?

I have installed VS 2008. When I try to build a project, I am getting an error saying:

Cannot open include file: 'afxcontrolbars.h': No such file or directory

So, I guess I need to have ribbon controls installed for this. Could you please tell me where the SDK is available for download? A link would be very helpful; I googled for it myself, but I could not find it. :(

like image 954
Naruto Avatar asked Mar 11 '11 09:03

Naruto


People also ask

Is Visual Studio 2008 still supported?

Visual Studio 2008 - Microsoft Lifecycle | Microsoft Learn. This browser is no longer supported. Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

How do I open Visual Studio 2008?

Select the . sln file in file explorer, right click, select "Open With", select "Visual Studio 2008" or "Visual Studio version Selector".


2 Answers

This seems like a weird problem to me. afxcontrolbars.h is certainly included in a standard VS 2008 installation. The only way you might be missing MFC components is if you installed the Express version, which doesn't come with support for MFC.

The first thing I would do is check to see if I could create and compile a brand new, blank MFC app using one of the built-in templates. If that works, there's something wrong with your project's properties.

Also check manually in the \Microsoft Visual Studio 9.0\VC\atlmfc\include directory to see if you can locate the header file before you try to manually re-install the platform SDK. It may be as simple as Visual Studio not being able to locate the file. To remedy that, open the Options dialog, expand the "Projects and Solutions" tree, select "VC++ Directories", select "Win32" and "Include files" from the combo boxes at the top, and ensure that $(VCInstallDir)atlmfc\include is included in the list:

  Visual Studio Options - Projects and Solutions - VC++ Directories - Win32 Include files

Of course, the ribbon control (and other ribbon-specific items) weren't added to VS 2008 until the MFC Feature Pack. You will need to download and install that in order to compile applications that take advantage of those features in VS 2008. You can download the Feature Pack here for free.

like image 174
Cody Gray Avatar answered Oct 04 '22 05:10

Cody Gray


I have VS2008 on a Win7 64 bit machine. In my case the include files where installed in the c:\program(x86) folder, but VS was installed in c:\program.

By changing the path to the "hardcoded" path

C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\atlmfc\include

it now works!

like image 31
Thomas Engdahl Avatar answered Oct 04 '22 04:10

Thomas Engdahl