// SimpleCGI.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "SimpleCGI.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// The one and only application object

CWinApp theApp;

using namespace std;

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
	int nRetCode = 0;

	// Output standard HTML CGI header
	cout << "Content-type: text/html\n\n";
	cout << "<HTML><BODY>" << endl;
	
	// initialize MFC and print and error on failure
	if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
	{
		// TODO: change error code to suit your needs
		cerr << "Fatal Error: MFC initialization failed<P>" << endl;
	}
	else
	{
		// TODO: code your application's behavior here.
		cout << "<H1>" << endl;
		cout << "Hey! This is my first CGI response!<P>" << endl;
		cout << "</H1>" << endl;
	}

	// Output standard HTML CGI footer
	cout << "</HTML></BODY>" << endl;

	return nRetCode;
}


