Repository navigation
Expand file tree
/
Copy pathstdafx.cpp
More file actions
71 lines (45 loc) · 2.08 KB
/
Copy pathstdafx.cpp
File metadata and controls
71 lines (45 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// stdafx.cpp : source file that includes just the standard includes
// ConsoleHook.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// global variables
HMODULE g_hModule = NULL;
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// Memory allocation tracking
#ifdef _DEBUG
void* __cdecl operator new(size_t nSize, LPCSTR lpszFileName, int nLine)
{
return ::_malloc_dbg(nSize, 1, lpszFileName, nLine);
}
void __cdecl operator delete(void* pData, LPCSTR /* lpszFileName */, int /* nLine */)
{
::operator delete(pData);
}
#endif
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// trace function and TRACE macro
#ifdef _DEBUG
#include <stdio.h>
void Trace(const wchar_t* pszFormat, ...)
{
wchar_t szOutput[1024];
va_list vaList;
va_start(vaList, pszFormat);
vswprintf(szOutput, _countof(szOutput), pszFormat, vaList);
::OutputDebugString(szOutput);
}
#endif // _DEBUG
//////////////////////////////////////////////////////////////////////////////