Freigeben über


CHttpServer not included in Visual Studio 2008

CHttpServer and CHttpFilter are not included in Visual Studio 2008.  You will get error messages such as: fatal error RC1015: cannot open include file 'afxisapi.rc'  fatal error C1083: Cannot open include file: 'afxisapi.h': No such file or directory.  You have to convert your projects to straight ISAPI API calls or come up with some other scheme (such as building the MFC libraries from another version of Visual Studio).  I used the following steps to build a CHttpServer based project in the Visual Studio 2008 environment as a temporary workaround so that you can build your projects based on CHttpServer:

How to build CHttpServer based projects with VS 2008.

The MFC ISAPI classes have been removed from VS 2008. I suggest you convert over to straight ISAPI calls since in reality these classes are simply a very thin wrapper around ISAPI API’s. Also, you own the code that you move over and build this way and you will not be able to get any security updates of support if you use this method.

I recently converted a couple of projects that had been built with the MFC wizard in VS 2003. For these I found by statically linking with the MFC libraries and copying some files from my VS 2005 environment to a local directory in my project, the projects built under VS 2008.

Statically Link with MFC libraries.

1. Right click on the project, select ‘All Configurations’ in the top left drop down box

2. Navigate to ‘Configuration Properties’, ‘General’ and change ‘Use of MFC’ to ‘Use MFC in a Static Library’

Change the C++, Linker, and Resources to point to a directory containing the legacy libraries, include files and resources.

1. I created a directory called ‘LegacyMFCISAPI’ in the project directory. I then copied the following files from my VS 2005 directories:

afxisapi.h

afxisapi.inl

afxisapi.rc

eafxis.lib

eafxis.pdb

eafxisd.lib

eafxisd.pdb

nafxis.lib

nafxis.pdb

nafxisd.lib

nafxisd.pdb

2. Add this to the Additional Include Directory for C++ and Resources settings to the Additional Libraries Directories for the Linker settings: $(SolutionDir)LegacyMFCISAPI

Build!

(Also see: https://blogs.msdn.com/jpsanders/archive/2008/01/17/building-with-atlserver-based-soap-project-with-visual-studio-2008.aspx for other informaton on building with the CodePlex AtlServer code.  These classes are NOT included in that code however. )