Jeff Sanders Technical Blog

I am a Microsoft employee that has worked on all aspects of the Web Stack for a long time. I hope these blogs are useful to you! Use this information at your own risk.


<< Go Back

Chttpserver Not Included In Visual Studio 2008

- 10 Dec 2007

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:<p class=MsoNormal style="MARGIN: 0in 0in 0pt">How to build CHttpServer based projects with VS 2008.</p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt">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.</p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt">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.</p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt">Statically Link with MFC libraries.</p> <p class=MsoListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1">

1.       Right click on the project, select  ‘All Configurations’ in the top left drop down box</p> <p class=MsoListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l1 level1 lfo1">2.       Navigate to ‘Configuration Properties’, ‘General’ and change ‘Use of MFC’ to ‘Use MFC in a Static Library’</p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt">Change the C++,  Linker, and Resources to point to a directory containing the legacy libraries, include files and resources.</p> <p class=MsoListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo2">1.       I created a directory called ‘LegacyMFCISAPI’ in the project directory.  I then copied the following files from my VS 2005 directories: </p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in">afxisapi.h</p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in">afxisapi.inl</p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in">afxisapi.rc</p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in">eafxis.lib</p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in">eafxis.pdb</p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in">eafxisd.lib</p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in">eafxisd.pdb</p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in">nafxis.lib</p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in">nafxis.pdb</p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in">nafxisd.lib</p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt 1in">nafxisd.pdb</p> <p class=MsoListParagraph style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal; mso-list: l0 level1 lfo2">2.       Add this to the Additional Include Directory for C++ and Resources settings to the Additional Libraries Directories for the Linker settings: $(SolutionDir)LegacyMFCISAPI</p> <p class=MsoNormal style="MARGIN: 0in 0in 0pt">Build!</p> <p mce_keep="true">(Also see: http://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. )</p>

<< Go Back