#pragma warning(disable: 4251) #include "testdll.h" #include "test_render.h" #include #include #include #include #include #include #include // TEST extern "C" MINI_DLL_API execute( MINI_SESSION* session, int argc, char** argv, char** buff, int* size, char* msg, int msglen ) { int result = 0; CzzCGIOutput output( false, "Content-Type: text/html\n\n" ); try { CzzArguments args( argc, argv, '-', 0 ); CzzString svc = args["svc"]; if( svc == "Test" ) { CTestRender r( session, &args ); output.append( r.render() ); *size = output.size(); *buff = output.allocReply(); } else throw CzzLogException( _LAF, 4711, "Not a valid service" ); } catch( CzzException& e ) { output.append( e.GetReason().c_str() ); *size = output.size(); *buff = output.allocReply(); result = e.GetCode(); } catch( ... ) { output.append( "UNDEFINED ERROR" ); *size = output.size(); *buff = output.allocReply(); result = 1; } return result; }