Export (0) Print
Expand All
Expand Minimize

REPLACEMENT_METHOD_ENTRY_EX 

Use this macro in a replacement method map to associate a replacement method with a particular tag name. Use when the replacement method needs to receive method arguments.


#define REPLACEMENT_METHOD_ENTRY_EX(
      methodName,
      methodFunc,
      paramType,
      parseFunc
)

Parameters

methodName

A string containing the name of the replacement tag that will map to the method specified by methodFunc.

methodFunc

The C++ method that will be called when tags matching methodName are encountered.

paramType

The C++ parameter type handled by methodFunc and parseFunc.

parseFunc

The C++ method that will be called to parse any arguments passed to the replacement method by means of a replacement tag in a server response file.

The replacement method specified by methodFunc should have the following signature:

HTTP_CODE methodFunc(paramType* pArg);

The argument parsing method specified by parseFunc should have the following signature:

HTTP_CODE parseFunc(IAtlMemMgr* pMemoryManager, LPCSTR szArg, paramType** ppArg);

Both functions should be members of the class containing the replacement method map.

parseFunc is responsible for:

  • Allocating memory for the argument to be passed to the replacement method using pMemoryManager->Allocate.

  • Setting the value of the argument to be passed to the replacement method using the data obtained from szArg.

  • Passing a pointer to the argument to be passed to the replacement method back through ppArg.

parseFunc is called only during stencil parsing. The memory allocated using pMemoryManager will be automatically freed by the framework when the stencil is unloaded.

This macro provides similar functionality to the tag_name attribute.

Header: atlstencil.h

Community Additions

ADD
Show:
© 2014 Microsoft