duilib自学教程
stdafx.h
1 // stdafx.h : include file for standard system include files,
2 // or project specific include files that are used frequently, but
3 // are changed infrequently
4 //
5 
6 #if !defined(AFX_STDAFX_H__E30B2003_188B_4EB4_AB99_3F3734D6CE6C__INCLUDED_)
7 #define AFX_STDAFX_H__E30B2003_188B_4EB4_AB99_3F3734D6CE6C__INCLUDED_
8 
9 #pragma once
10 
11 #ifdef __GNUC__
12 // 怎么都没找到min,max的头文件-_-
13 #ifndef min
14 #define min(a,b) (((a) < (b)) ? (a) : (b))
15 #endif
16 #ifndef max
17 #define max(a,b) (((a) > (b)) ? (a) : (b))
18 #endif
19 #endif
20 
21 #ifndef __FILET__
22 #define __DUILIB_STR2WSTR(str) L##str
23 #define _DUILIB_STR2WSTR(str) __DUILIB_STR2WSTR(str)
24 #ifdef _UNICODE
25 #define __FILET__ _DUILIB_STR2WSTR(__FILE__)
26 #define __FUNCTIONT__ _DUILIB_STR2WSTR(__FUNCTION__)
27 #else
28 #define __FILET__ __FILE__
29 #define __FUNCTIONT__ __FUNCTION__
30 #endif
31 #endif
32 
33 #define _CRT_SECURE_NO_DEPRECATE
34 
35 // Remove pointless warning messages
36 #ifdef _MSC_VER
37 #pragma warning (disable : 4511) // copy operator could not be generated
38 #pragma warning (disable : 4512) // assignment operator could not be generated
39 #pragma warning (disable : 4702) // unreachable code (bugs in Microsoft's STL)
40 #pragma warning (disable : 4786) // identifier was truncated
41 #pragma warning (disable : 4996) // function or variable may be unsafe (deprecated)
42 #ifndef _CRT_SECURE_NO_WARNINGS
43 #define _CRT_SECURE_NO_WARNINGS // eliminate deprecation warnings for VS2005
44 #endif
45 #endif // _MSC_VER
46 #ifdef __BORLANDC__
47 #pragma option -w-8027 // function not expanded inline
48 #endif
49 
50 // Required for VS 2008 (fails on XP and Win2000 without this fix)
51 #ifndef _WIN32_WINNT
52 #define _WIN32_WINNT 0x0500
53 #endif
54 
55 #include "UIlib.h"
56 
57 #include <olectl.h>
58 
59 #define lengthof(x) (sizeof(x)/sizeof(*x))
60 #define MAX max
61 #define MIN min
62 #define CLAMP(x,a,b) (MIN(b,MAX(a,x)))
63 
64 //{{AFX_INSERT_LOCATION}}
65 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
66 
67 #endif // !defined(AFX_STDAFX_H__E30B2003_188B_4EB4_AB99_3F3734D6CE6C__INCLUDED_)