OSDN Git Service

add spell check
[tortoisegit/TortoiseGitJp.git] / src / Utils / DebugHelpers.h
1 // TortoiseSVN - a Windows shell extension for easy version control\r
2 \r
3 // Copyright (C) 2003-2006 - Stefan Kueng\r
4 \r
5 // This program is free software; you can redistribute it and/or\r
6 // modify it under the terms of the GNU General Public License\r
7 // as published by the Free Software Foundation; either version 2\r
8 // of the License, or (at your option) any later version.\r
9 \r
10 // This program is distributed in the hope that it will be useful,\r
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13 // GNU General Public License for more details.\r
14 \r
15 // You should have received a copy of the GNU General Public License\r
16 // along with this program; if not, write to the Free Software Foundation,\r
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\r
18 //\r
19 #pragma once\r
20 \r
21 #ifdef _DEBUG\r
22 #       define BEGIN_TICK   { DWORD dwTickMeasureBegin = ::GetTickCount();\r
23 #       define END_TICK(s) DWORD dwTickMeasureEnd = ::GetTickCount(); TRACE("%s: tick count = %d\n", s, dwTickMeasureEnd-dwTickMeasureBegin); }\r
24 #else\r
25 #       define BEGIN_TICK\r
26 #       define END_TICK(s)\r
27 #endif\r
28 \r
29 /**\r
30  * \ingroup CommonClasses\r
31  * returns the string to the given error number.\r
32  * \param err the error number, obtained with GetLastError() or WSAGetLastError() or ...\r
33  */\r
34 CString GetLastErrorMessageString(int err);\r
35 /*\r
36  * \ingroup CommonClasses\r
37  * returns the string to the GetLastError() function.\r
38  */\r
39 CString GetLastErrorMessageString();\r
40 \r
41 #define MS_VC_EXCEPTION 0x406d1388\r
42 \r
43 typedef struct tagTHREADNAME_INFO\r
44 {\r
45         DWORD dwType;        // must be 0x1000\r
46         LPCSTR szName;       // pointer to name (in same addr space)\r
47         DWORD dwThreadID;    // thread ID (-1 caller thread)\r
48         DWORD dwFlags;       // reserved for future use, most be zero\r
49 } THREADNAME_INFO;\r
50 \r
51 /**\r
52  * Sets a name for a thread. The Thread name must not exceed 9 characters!\r
53  * Inside the current thread you can use -1 for dwThreadID.\r
54  * \param dwThreadID The Thread ID\r
55  * \param szThreadName A name for the thread.\r
56  */   \r
57 void SetThreadName(DWORD dwThreadID, LPCTSTR szThreadName);\r