User Guide

762 Chapter 4: ColdFusion C++ CFX Reference
CCFXRequest::GetQuery
Syntax
CCFXQuery* CCFXRequest::GetQuery(void)
Description
Retrieves a query that was passed to a tag. To pass a query to a custom tag, you use the QUERY
attribute. This attribute should be set to the name of a query (created using the CFQUERY tag or
another custom tag). The
QUERY attribute is optional and should be used only by tags that process
an existing data set.
Returns
Returns an object of the CCFXQuery class that represents the query passed to the tag. If no
query was passed to the tag,
NULL is returned. The memory allocated for the returned query is
freed automatically by ColdFusion after the request is completed.
Example
The following example retrieves the query that was passed to the tag. If no query was passed, an
exception is thrown:
CCFXQuery* pQuery = pRequest->GetQuery() ;
if ( pQuery == NULL )
{
pRequest->ThrowException(
"Missing QUERY parameter",
"You must pass a QUERY parameter in "
"order for this tag to work correctly." ) ;
}
CCFXRequest::ReThrowException
Syntax
void CCFXRequest::ReThrowException(CCFXException* e)
Description
Re-throws an exception that has been caught within an extension procedure. This function is
used to avoid having C++ exceptions that are thrown by DLL extension code propagate back into
ColdFusion. Catch ALL C++ exceptions that occur in extension code, and either re-throw them
(if they are of the
CCFXException class) or create and throw a new exception pointer using
CCFXRequest::ThrowException.
Parameters
Parameter Description
e A CCFXException that has been caught