Article ID: 938361 - Last Review: July 5, 2007 - Revision: 1.0
Extra carriage return characters and extra line feed characters appear when you convert an MFC ISAPI based-project in Visual Studio 2005
SYMPTOMS
When you convert an MFC ISAPI-based project that is created in an early version of Visual Studio to Microsoft Visual Studio 2005, an extra set of carriage return characters (/r) and line feed characters (/n) appears. This problem occurs when you use the CHttpServerContext class.
For example, this problem occurs you modify a default MFC ISAPI project, as follows:
For example, this problem occurs you modify a default MFC ISAPI project, as follows:
void CTestIISDLLExtension::Default(CHttpServerContext* pCtxt, void* pVoid, DWORD dwBytes)
{
// StartContent(pCtxt);
// WriteTitle(pCtxt);
*pCtxt << _T("Test");
// EndContent(pCtxt);
}
WORKAROUND
To work around this problem, add a header to the return stream.
For example, the project may contain the following code:To work around this problem, change the code to the following code:
For example, the project may contain the following code:
void CTestIISDLLExtension::Default(CHttpServerContext* pCtxt, void* pVoid, DWORD dwBytes)
{
// StartContent(pCtxt);
// WriteTitle(pCtxt);
*pCtxt << _T("Test");
// EndContent(pCtxt);
}
void CTestIISDLLExtension::Default(CHttpServerContext* pCtxt, void* pVoid, DWORD dwBytes)
{
// StartContent(pCtxt);
// WriteTitle(pCtxt);
this->AddHeader(pCtxt,"Dummy: My Header");
*pCtxt << _T("Test");
// EndContent(pCtxt);
}
STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
Note: This article is from Microsoft Knowledage Base
Related problems posted by other users | |
| more... |

