Hi All.

I need to write a C++ CFX tag for Linux and I've not done one before,
so I thought I would start with a simply "Hello World" application.
Here the code in the my C++ file...

// Include Standard Librarys (not if they are needed at this point)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include "cfx.h"                // CFX Custom Tag API

// Constants
#define TAG_ERROR_HEADER        "Error occurred in Test tag"

extern "C"
void ProcessTagRequest( CCFXRequest* pRequest ) 
{
        try
        {
        pRequest->Write( "Hello World" );
        }

        // Catch Cold Fusion exceptions & re-raise them
        catch( CCFXException* e )
        {
                pRequest->ReThrowException( e ) ;
        }
        
        // Catch ALL other exceptions and throw them as 
        // Cold Fusion exceptions (DO NOT REMOVE! -- 
        // this prevents the server from crashing in 
        // case of an unexpected exception)
        catch( ... )
        {
                pRequest->ThrowException( 
                        TAG_ERROR_HEADER,
                        "Unexpected error occurred while processing tag." ) ;
        }
}

I then compiled this using the following Makefile:

INCLUDE = -I /opt/coldfusionmx/cfx/include
CXX = g++ 
LD = g++

SRC = request.cc
OBJ = request.o

test.so:        $(OBJ)
        $(LD) -shared -o test.so $(OBJ) 

request.o: request.cc
        $(CXX) $(INCLUDE) -c request.cc

clean:
        rm -f test.so $(OBJ)

This all compiled ok and create a test.so file. I registered this via
CF Admin as CFX_test and then create a create a script to call
CFX_test:

<CFX_test>

I then called this script via the browser and all I get is a blank
page. I had asssumed I would see "Hello World" in the browser, but
nothing. There are no error messages either when compiling,
registering or running the script. Can anyone help point me in the
right direction as I guess I'm doing something completely wrong
somewhere along the way.

Best Regards

Andrew.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware: a new and convenient web-based time tracking application. Start 
tracking and documenting hours spent on a project or with a client with Logware 
today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190743
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to