User Guide
306 Developing Web Applications with ColdFusion
void ProcessTagRequest( CCFXRequest* pRequest )
{
try
{
MYTAGDATA tagData ;
pRequest->SetCustomData( (LPVOID)&tagData ) ;
... remainder of procedure ...
}
CCFXRequest::SetVariable
void CCFXRequest::SetVariable(LPCSTR
lpszName
, LPCSTR
lpszValue
)
Sets a variable in the calling template. If the variable name specified already exists in
the template, its value is replaced. If it does not already exist, a new variable is created.
The values of variables created using
SetVariable can be accessed in the same
manner as other template variables (e.g., #MessageSent#).
lpszName
Name of variable.
lpszValue
Value of variable.
Example
The following example sets the value of a variable named ’MessageSent’ based on the
success of an operation performed by the custom tag:
BOOL bMessageSent ;
...attempt to send the message...
if ( bMessageSent == TRUE )
{
pRequest->SetVariable( "MessageSent", "Yes" ) ;
}
else
{
pRequest->SetVariable( "MessageSent", "No" ) ;
}
CCFXRequest::ThrowException
void CCFXRequest::ThrowException(LPCSTR
lpszError
,
LPCSTR
lpszDiagnostics
)
Throws an exception and ends processing of this request. You should call this function
when you encounter an error that does not allow you to continue processing the
request. Note that this function is almost always combined with the