User Guide
Chapter 18: Building Custom CFAPI Tags 305
your extension code and then either re-throw them (if they are of the CCFXException
Class) or create and throw a new exception pointer using
CCFXRequest::ThrowException.
e
An existing CCFXException that has been caught.
Example
The following code demonstrates the correct way to handle exceptions in ColdFusion
Extension DLL procedures:
try
{
...Code that could throw an exception...
}
catch( CCFXException* e )
{
...Do appropriate resource cleanup here...
// Re-throw the exception
pRequest->ReThrowException( e ) ;
}
catch( ... )
{
// Something nasty happened
pRequest->ThrowException(
"Unexpected error occurred in CFX tag", "" ) ;
}
CCFXRequest::SetCustomData
void CCFXRequest::SetCustomData(LPVOID
lpvData
)
Sets custom (tag specific) data to carry along with the request. You should use this
function to store request specific data that you want to pass along to procedures within
your custom tag implementation.
lpvData
Pointer to custom data.
Example
The following example creates a request-specific data structure of hypothetical type
MYTAGDATA and stores a pointer to the structure in the request for future use: