问题描述
- 求各位帮我看看这段代码怎么改改
-
我想做个ISAPI的扩展程序,平台是vs2010,然后建立了一个 win32控制台控程序 代码如下
enter code here?#include
#include
#include
#include
#include //ISAPI扩展的头文件void WriteContext(EXTENSION_CONTROL_BLOCK *pECB, char *pszFormat);
void StartContext(EXTENSION_CONTROL_BLOCK *pECB);
void EndContext(EXTENSION_CONTROL_BLOCK *pECB);BOOL APIENTRY DLLMain(HANDLE hModule, DWORD dwCallReason, LPVOID lpReserved)
{
return TRUE;
}BOOL WINAPI GetExtensionVersion(HSE_VERSION_INFO *pVer)
{
pVer->dwExtensionVersion = HSE_VERSION;
strncpy(pVer->lpszExtensionDesc, "My first ISAPI program", HSE_MAX_EXT_DLL_NAME_LEN);
return TRUE;
}DWORD WINAPI HttpExtensionProc(EXTENSION_CONTROL_BLOCK *pECB)
{
StartContext(pECB);
WriteContext(pECB, "this is my first ISAPI program!!hello money!!
");
EndContext(pECB);
return HSE_STATUS_SUCCESS;
}BOOL WINAPI TerminateExtension(DWORD dwFlags)
{
return TRUE;
}void WriteContext(EXTENSION_CONTROL_BLOCK *pECB, char *pszFormat)
{
char szBuffer[1024];
va_list arg_ptr;
va_start(arg_ptr, pszFormat);
vsprintf(szBuffer, pszFormat, arg_ptr);
va_end(arg_ptr);DWORD dwSize = strlen(szBuffer); pECB->WriteClient(pECB->ConnID, szBuffer, &dwSize, 0);
}
void StartContext(EXTENSION_CONTROL_BLOCK *pECB)
{
WriteContext(pECB, "rnrn");
}void EndContext(EXTENSION_CONTROL_BLOCK *pECB)
{
WriteContext(pECB, "rn");
}
提示错误是
错误 3 error LNK1561: 必须定义入口点 D:学习testweb.nethello11hello11LINK hello11
请问各位我该怎么设置