// replay.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "LogParser.h" #include "SAXContentHandlerImpl.h" #include int _tmain(int argc, _TCHAR* argv[]) { if (argc<3) { std::wcout << "Usage: " << argv[0] << " " << std::endl; return 0; } // execute application to be replayed /*if (argc>2) { std::wcout << "executing " << argv[2] << std::endl; PROCESS_INFORMATION pi; STARTUPINFO si; ZeroMemory(&pi, sizeof(pi)); ZeroMemory(&si, sizeof(si)); CreateProcess(NULL, argv[2], NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); Sleep(10000); }*/ // initialize COM library for the current thread CoInitialize(NULL); MSXML2::ISAXXMLReader* pXMLReader = NULL; // create an instance of the XML reader HRESULT hr = CoCreateInstance( __uuidof(MSXML2::SAXXMLReader), NULL, CLSCTX_ALL, __uuidof(MSXML2::ISAXXMLReader), (void **)&pXMLReader); if( !FAILED(hr) ) { std::wcout << L"replaying sessions in " << argv[1] << std::endl; LogParser * parser = new LogParser(argv[2], 5000, true); pXMLReader->putContentHandler(parser); hr = pXMLReader->parseURL(argv[1]); pXMLReader->Release(); std::wcout << L"================================================" << std::endl; std::wcout << L"replay completed" << std::endl; } CoUninitialize(); std::wcout << L"press enter to exit ..."; getchar(); return 0; }