source: trunk/Utilities/LogProcessExceptions/PeriodicException/PeriodicException.cpp @ 61

Last change on this file since 61 was 61, checked in by roman, 12 years ago
  • moved from assembla
  • early add Debug privilege in order to be able to list service processes
  • cosmetic fix
  • Property svn:keywords set to Id
File size: 623 bytes
RevLine 
[61]1////////////////////////////////////////////////////////////
2// Copyright (C) Roman Ryltsov, 2008-2011
3// Created by Roman Ryltsov roman@alax.info
4//
5// $Id: PeriodicException.cpp 61 2012-04-27 10:54:06Z roman $
6
7#include "stdafx.h"
8#include <eh.h>
9
10int _tmain(int argc, _TCHAR* argv[])
11{
12        //for(; ; )
13        //{
14        //      if(GetKeyState(VK_CONTROL) < 0)
15        //              abort();
16        //      Sleep(1000);
17        //}
18        for(UINT nIndex = 0; ; nIndex++)
19        {
20                _ATLTRY
21                {
22                        if(nIndex & 3)
23                                AtlThrow(MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, nIndex & 0xFFF)); // C++ Exception
24                        GetSystemTime(NULL); // Win32 Exception
25                }
26                _ATLCATCHALL()
27                {
28                }
29                Sleep(5000);
30        }
31        return 0;
32}
33
Note: See TracBrowser for help on using the repository browser.