source: trunk/MFCtooling/replay/replay.cpp @ 78

Last change on this file since 78 was 65, checked in by sherbold, 14 years ago

+ minor usability change

File size: 1.2 KB
RevLine 
[32]1// replay.cpp : Defines the entry point for the console application.
2//
3
4#include "stdafx.h"
5
6#include "LogParser.h"
7#include "SAXContentHandlerImpl.h"
8#include <iostream>
9
10int _tmain(int argc, _TCHAR* argv[])
11{
12        if (argc<2)
13        {
14                wprintf(L"no argument provided\n");
15                return 0;
16        }
17
18        // execute application to be replayed
19        if (argc>2) {
20                std::wcout << "executing " << argv[2] << std::endl;
21                PROCESS_INFORMATION pi;
22                STARTUPINFO si;
23                ZeroMemory(&pi, sizeof(pi));
24                ZeroMemory(&si, sizeof(si));
25                CreateProcess(NULL, argv[2], NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
26                Sleep(10000);
27        }
28
29
30        // initialize COM library for the current thread
31        CoInitialize(NULL);
32        MSXML2::ISAXXMLReader* pXMLReader = NULL;
33
34        // create an instance of the XML reader
35        HRESULT hr = CoCreateInstance(
36                __uuidof(MSXML2::SAXXMLReader),
37                NULL,
38                CLSCTX_ALL,
39                __uuidof(MSXML2::ISAXXMLReader),
40                (void **)&pXMLReader);
41
42        if( !FAILED(hr) ) {
43                LogParser * parser = new LogParser();
44                pXMLReader->putContentHandler(parser);
45                hr = pXMLReader->parseURL(argv[1]);
46
47                pXMLReader->Release();
48        }
49
50        CoUninitialize();
51
[65]52        std::wcout << "Press enter to exit ...";
[32]53        getchar();
54
55        return 0;
56}
57
Note: See TracBrowser for help on using the repository browser.