forked from SomeSupport/eMule
-
Notifications
You must be signed in to change notification settings - Fork 97
/
AfxBeginMsgMapTemplate.h
89 lines (77 loc) · 3.81 KB
/
AfxBeginMsgMapTemplate.h
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// ------------------------------------------------------------
// BEGIN_MESSAGE_MAP_TEMPLATE
// MFC (VisualC++ 6/7) BEGIN_MESSAGE_MAP template compatibility
// ------------------------------------------------------------
// AfxBeginMsgMapTemplate.hpp
// zegzav - 1/10/2002 - eMule project (http://www.emule-project.net)
// ------------------------------------------------------------
#pragma once
#if _MFC_VER >= 0x0600 && _MFC_VER < 0x0700
// MFC for Visual C++ 6.0 (MFC 4.x)
#ifdef _AFXDLL
#define BEGIN_MESSAGE_MAP_TEMPLATE(templateList, templateClass, theClass, baseClass) \
templateList const AFX_MSGMAP* PASCAL templateClass::_GetBaseMessageMap() \
{ return &baseClass::messageMap; } \
templateList const AFX_MSGMAP* templateClass::GetMessageMap() const \
{ return &theClass::messageMap; } \
templateList AFX_COMDAT AFX_DATADEF const AFX_MSGMAP templateClass::messageMap = \
{ &theClass::_GetBaseMessageMap, &theClass::_messageEntries[0] }; \
templateList AFX_COMDAT const AFX_MSGMAP_ENTRY templateClass::_messageEntries[] = \
{
#else
#define BEGIN_MESSAGE_MAP_TEMPLATE(templateList, templateClass, theClass, baseClass) \
templateList const AFX_MSGMAP* templateClass::GetMessageMap() const \
{ return &theClass::messageMap; } \
templateList AFX_COMDAT AFX_DATADEF const AFX_MSGMAP templateClass::messageMap = \
{ &baseClass::messageMap, &theClass::_messageEntries[0] }; \
templateList AFX_COMDAT const AFX_MSGMAP_ENTRY templateClass::_messageEntries[] = \
{
#endif
#elif _MFC_VER >= 0x0700 && _MFC_VER < 0x0800
// MFC for Visual C++ 7.0 (MFC 7.x)
#ifdef _AFXDLL
#define BEGIN_MESSAGE_MAP_TEMPLATE(templateList, templateClass, theClass, baseClass) \
templateList const AFX_MSGMAP* PASCAL templateClass::GetThisMessageMap() \
{ return &theClass::messageMap; } \
templateList const AFX_MSGMAP* templateClass::GetMessageMap() const \
{ return &theClass::messageMap; } \
templateList /*AFX_COMDAT*/ const AFX_MSGMAP templateClass::messageMap = \
{ &baseClass::GetThisMessageMap, &theClass::_messageEntries[0] }; \
templateList /*AFX_COMDAT*/ const AFX_MSGMAP_ENTRY templateClass::_messageEntries[] = \
{
#else
#define BEGIN_MESSAGE_MAP_TEMPLATE(templateList, templateClass, theClass, baseClass) \
templateList const AFX_MSGMAP* templateClass::GetMessageMap() const \
{ return &theClass::messageMap; } \
templateList /*AFX_COMDAT*/ const AFX_MSGMAP templateClass::messageMap = \
{ &baseClass::messageMap, &theClass::_messageEntries[0] }; \
templateList /*AFX_COMDAT*/ const AFX_MSGMAP_ENTRY templateClass::_messageEntries[] = \
{
#endif
#elif _MFC_VER>=0x0800
// MFC for Visual C++ 7.0 (MFC 7.x)
#ifdef _AFXDLL
#define BEGIN_MESSAGE_MAP_TEMPLATE(templateList, templateClass, theClass, baseClass) \
templateList const AFX_MSGMAP* PASCAL templateClass::GetThisMessageMap() \
{ return &theClass::messageMap; } \
templateList const AFX_MSGMAP* templateClass::GetMessageMap() const \
{ return &theClass::messageMap; } \
templateList /*AFX_COMDAT*/ const AFX_MSGMAP templateClass::messageMap = \
{ &baseClass::GetThisMessageMap, &theClass::_messageEntries[0] }; \
templateList /*AFX_COMDAT*/ const AFX_MSGMAP_ENTRY templateClass::_messageEntries[] = \
{
#else
#define BEGIN_MESSAGE_MAP_TEMPLATE(templateList, templateClass, theClass, baseClass) \
PTM_WARNING_DISABLE \
templateList const AFX_MSGMAP* templateClass::GetMessageMap() const \
{ return GetThisMessageMap(); } \
templateList const AFX_MSGMAP* PASCAL templateClass::GetThisMessageMap() \
{ \
typedef theClass ThisClass; \
typedef baseClass TheBaseClass; \
static const AFX_MSGMAP_ENTRY _messageEntries[] = \
{
#endif
#else
#error "MFC version not supported"
#endif