Whatever message this page gives is out now! Go check it out!
virtual BOOL AttributeExists( LPCSTR lpszName ) | :AttributeExists checks whether the attribute was passed to the tag. |
virtual LPCSTR GetAttribute( LPCSTR lpszName ) | :GetAttribute gets the value of the passed attribute. |
virtual CCFXStringSet* GetAttributeList() | :GetAttributeList gets an array of attribute names passed to the tag. |
virtual CCFXQuery* GetQuery() | :GetQuery gets the query that was passed to the tag. |
virtual LPCSTR GetSetting( LPCSTR lpszSettingName ) | {{CCFXRequest::GetSetting}}This method is deprecated. It might not work, and might cause an error, in later releases. |
virtual void Write( LPCSTR lpszOutput ) | :Write writes text output back to the user. |
virtual void SetVariable( LPCSTR lpszName, LPCSTR lpszValue ) | :SetVariable sets a variable in the template that contains this tag. |
virtual CCFXQuery* AddQuery( LPCSTR lpszName, CCFXStringSet* pColumns ) | :AddQuery adds a query to the template that contains this tag. |
virtual BOOL Debug() | :Debug checks whether the tag contains the Debug attribute. |
virtual void WriteDebug( LPCSTR lpszOutput ) | :WriteDebug writes text output into the debug stream. |
virtual CCFXStringSet* CreateStringSet() | :CreateStringSet allocates and returns a CCFXStringSet instance. |
virtual void ThrowException( LPCSTR lpszError, LPCSTR lpszDiagnostics ) | :ThrowException throws an exception and ends processing of this request. |
virtual void ReThrowException( CCFXException* e ) | :ReThrowException rethrows an exception that has been caught. |
virtual void SetCustomData( LPVOID lpvData ) | :SetCustomData sets custom (tag specific) data to carry with a request. |
virtual LPVOID GetCustomData() | :GetCustomData gets custom (tag specific) data for a request. |
CCFXQuery* CCFXRequest::AddQuery(LPCSTR lpszName, CCFXStringSet* pColumns) |
| Parameter | Description |
lpszName | Name of query to add to the template (must be unique) |
pColumns | List of column names to be used in the query |
// Create a string set and add the column names to it CCFXStringSet* pColumns = pRequest->CreateStringSet() ; int iFirstName = pColumns->AddString( "FirstName" ) ; int iLastName = pColumns->AddString( "LastName" ) ; // Create a query that contains these columns CCFXQuery* pQuery = pRequest->AddQuery( "People", pColumns ) ; // Add data to the query int iRow ; iRow = pQuery->AddRow() ; pQuery->SetData( iRow, iFirstName, "John" ) ; pQuery->SetData( iRow, iLastName, "Smith" ) ; iRow = pQuery->AddRow() ; pQuery->SetData( iRow, iFirstName, "Jane" ) ; pQuery->SetData( iRow, iLastName, "Doe" ) ; |
BOOL CCFXRequest::AttributeExists(LPCSTR lpszName) |
| Parameter | Description |
lpszName | Name of the parameter to check (case insensitive) |
if ( pRequest->AttributeExists("DESTINATION")==FALSE ) { pRequest->ThrowException( "Missing DESTINATION parameter", "You must pass a DESTINATION parameter in " "order for this tag to work correctly." ) ; } |
CCFXStringSet* CCFXRequest::CreateStringSet(void) |
CCFXStringSet* pColors = pRequest->CreateStringSet() ; pColors->AddString( "Red" ) ; pColors->AddString( "Green" ) ; pColors->AddString( "Blue" ) ; |
BOOL CCFXRequest::Debug(void) |
if ( pRequest->Debug() ) { pRequest->WriteDebug( "Top secret debug info" ) ; } |
LPCSTR CCFXRequest::GetAttribute(LPCSTR lpszName) |
| Parameter | Description |
lpszName | Name of the attribute to retrieve (case insensitive) |
LPCSTR lpszDestination = pRequest->GetAttribute("DESTINATION") ; pRequest->Write( "The destination is: " ) ; pRequest->Write( lpszDestination ) ; |
CCFXStringSet* CCFXRequest::GetAttributeList(void) |
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>" ) ; } |
LPVOID CCFXRequest::GetCustomData(void) |
void DoSomeGruntWork( CCFXRequest* pRequest ) { MYTAGDATA* pTagData = (MYTAGDATA*)pRequest->GetCustomData() ; ... remainder of procedure ... } |
CCFXQuery* CCFXRequest::GetQuery(void) |
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." ) ; } |
void CCFXRequest::ReThrowException(CCFXException* e) |
| Parameter | Description |
e | A CCFXException that has been caught |
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", "" ) ; } |
void CCFXRequest::SetCustomData(LPVOID lpvData) |
| Parameter | Description |
lpvData | Pointer to custom data |
void ProcessTagRequest( CCFXRequest* pRequest ) try { MYTAGDATA tagData ; pRequest->SetCustomData( (LPVOID)&tagData ) ; ... remainder of procedure ... } |
void CCFXRequest::SetVariable(LPCSTR lpszName, LPCSTR lpszValue) |
| Parameter | Description |
lpszName | Name of variable |
lpszValue | Value of variable |
BOOL bMessageSent; ...attempt to send the message... if ( bMessageSent == TRUE ) { pRequest->SetVariable( "MessageSent", "Yes" ) ; } else { pRequest->SetVariable( "MessageSent", "No" ) ; } |
void CCFXRequest::ThrowException(LPCSTR lpszError, LPCSTR lpszDiagnostics) |
| Parameter | Description |
lpszError | Short identifier for error |
lpszDiagnostics | Error diagnostic information |
char buffError[512] ; wsprintf( buffError, "Unexpected Windows NT error number %ld " "occurred while processing request.", GetLastError() ) ; pRequest->ThrowException( "Error occurred", buffError ) ; |
void CCFXRequest::Write(LPCSTR lpszOutput) |
| Parameter | Description |
lpszOutput | Text to output |
CHAR buffOutput[1024] ; wsprintf( buffOutput, "The destination is: %s", pRequest->GetAttribute("DESTINATION") ) ; pRequest->Write( buffOutput ) ; |
void CCFXRequest::WriteDebug(LPCSTR lpszOutput) |
| Parameter | Description |
lpszOutput | Text to output |
if ( pRequest->Debug() ) { pRequest->WriteDebug( "Top secret debug info" ) ; } |