Chapter 18: Building Custom CFAPI Tags
303
You are not responsible for freeing the memory allocated for the returned string set (it
will be freed automatically by ColdFusion after the request is completed).
Example
The following example retrieves the list of attributes and then iterates over the list,
writing each attribute and its value back to the user.
LPCSTR lpszName, lpszValue ;
CCFXStringSet* pAttribs = pRequest->GetAttributeList() ;
int nNumAttribs = pAttribs->GetCount() ;
for( int i=1; i<=nNumAttribs; i++ )
{
lpszName = pAttribs->GetString( i ) ;
lpszValue = pRequest->GetAttribute( lpszName ) ;
pRequest->Write( lpszName ) ;
pRequest->Write( " = " ) ;
pRequest->Write( lpszValue ) ;
pRequest->Write( "<BR>" ) ;
}
CCFXRequest::GetCustomData
LPVOID CCFXRequest::GetCustomData(void)
Gets the custom (tag specific) data for the request. This member is typically used from
within subroutines of your tag implementation to extract tag specific data from within
the request.
Returns a pointer to the custom data or returns
NULL
if no custom data has been set
during this request using
CCFXRequest::SetCustomData
.
Example
The following example retrieves a pointer to a request specific data structure of
hypothetical type MYTAGDATA:
void DoSomeGruntWork( CCFXRequest* pRequest )
{
MYTAGDATA* pTagData =
(MYTAGDATA*)pRequest->GetCustomData() ;
... remainder of procedure ...
}
CCFXRequest::GetQuery
CCFXQuery* CCFXRequest::GetQuery(void)
Retrieves the query that was passed to the tag. To pass a query to a custom tag, you use
the
QUERY
attribute. This attribute should be set to the name of an existing query
Summary of Contents for COLDFUSION 4.5-DEVELOPING WEB
Page 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Page 14: ...xiv Developing Web Applications with ColdFusion...
Page 26: ...xxvi Developing Web Applications with ColdFusion...
Page 34: ...8 Developing Web Applications with ColdFusion...
Page 70: ...44 Developing Web Applications with ColdFusion...
Page 84: ...58 Developing Web Applications with ColdFusion...
Page 114: ...88 Developing Web Applications with ColdFusion...
Page 148: ...122 Developing Web Applications with ColdFusion...
Page 174: ...148 Developing Web Applications with ColdFusion...
Page 208: ...182 Developing Web Applications with ColdFusion...
Page 244: ...218 Developing Web Applications with ColdFusion...
Page 274: ...248 Developing Web Applications with ColdFusion...
Page 288: ...262 Developing Web Applications with ColdFusion...
Page 300: ...274 Developing Web Applications with ColdFusion...
Page 350: ...324 Developing Web Applications with ColdFusion...
Page 362: ...336 Developing Web Applications with ColdFusion...