📄 responseobject.cpp
字号:
/********************************************************************/
/* */
/* ResponseObject.cpp */
/* */
/* Implementation of the CResponseObject class. */
/* */
/* Programmed by Pablo van der Meer */
/* http://www.pablovandermeer.nl */
/* */
/* Last updated: 22 february 2003 */
/* */
/********************************************************************/
#include "stdafx.h"
#include "ResponseObject.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
IMPLEMENT_DYNCREATE(CResponseObject, CCmdTarget)
/********************************************************************/
/* */
/* Function name : CResponseObject::CResponseObject */
/* Description : Constructor */
/* */
/********************************************************************/
CResponseObject::CResponseObject()
{
EnableAutomation();
m_strResponseBuffer.Empty();
m_bEnabled = TRUE;
}
/********************************************************************/
/* */
/* Function name : CResponseObject::~CResponseObject */
/* Description : Destructor */
/* */
/********************************************************************/
CResponseObject::~CResponseObject()
{
}
/********************************************************************/
/* */
/* Function name : OnFinalRelease */
/* Description : */
/* */
/********************************************************************/
void CResponseObject::OnFinalRelease()
{
// When the last reference for an automation object is released
// OnFinalRelease is called. The base class will automatically
// deletes the object. Add additional cleanup required for your
// object before calling the base class.
CCmdTarget::OnFinalRelease();
}
BEGIN_MESSAGE_MAP(CResponseObject, CCmdTarget)
//{{AFX_MSG_MAP(CResponseObject)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BEGIN_DISPATCH_MAP(CResponseObject, CCmdTarget)
//{{AFX_DISPATCH_MAP(CResponseObject)
DISP_FUNCTION(CResponseObject, "Clear", Clear, VT_EMPTY, VTS_NONE)
DISP_FUNCTION(CResponseObject, "End", End, VT_EMPTY, VTS_NONE)
DISP_FUNCTION(CResponseObject, "Write", Write, VT_EMPTY, VTS_BSTR)
//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()
// Note: we add support for IID_IResponseObject to support typesafe binding
// from VBA. This IID must match the GUID that is attached to the
// dispinterface in the .ODL file.
// {149534DD-4630-4BDF-BDC2-498B9942E31A}
static const IID IID_IResponseObject =
{ 0x149534dd, 0x4630, 0x4bdf, { 0xbd, 0xc2, 0x49, 0x8b, 0x99, 0x42, 0xe3, 0x1a } };
BEGIN_INTERFACE_MAP(CResponseObject, CCmdTarget)
INTERFACE_PART(CResponseObject, IID_IResponseObject, Dispatch)
END_INTERFACE_MAP()
/********************************************************************/
/* */
/* Function name : Clear */
/* Description : Erases any buffered HTML output. */
/* */
/********************************************************************/
void CResponseObject::Clear()
{
// Re-enable processing
m_bEnabled = TRUE;
m_strResponseBuffer.Empty();
}
/********************************************************************/
/* */
/* Function name : End */
/* Description : Causes the server to stop processing a script */
/* and return the current response. */
/* */
/********************************************************************/
void CResponseObject::End()
{
m_bEnabled = FALSE;
}
/********************************************************************/
/* */
/* Function name : Write */
/* Description : Writes a variant to the HTTP output. */
/* */
/********************************************************************/
void CResponseObject::Write(LPCTSTR lpszText)
{
if (m_bEnabled)
m_strResponseBuffer += lpszText;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -