Skip to content

Commit 4021802

Browse files
committed
add TextInclude1Test2
1 parent 6eab671 commit 4021802

File tree

6 files changed

+137
-0
lines changed

6 files changed

+137
-0
lines changed

tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ add_subdirectory(ResTest)
33
add_subdirectory(ResTest2)
44
add_subdirectory(ToolbarTest)
55
add_subdirectory(TextInclude1Test)
6+
add_subdirectory(TextInclude1Test2)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
add_executable(TextInclude1Test2 WIN32 TextInclude1Test2.cpp TextInclude1Test2_res.rc)
2+
target_link_libraries(TextInclude1Test2 comctl32)
3+
4+
# do statically link
5+
set_target_properties(TextInclude1Test2 PROPERTIES LINK_SEARCH_START_STATIC 1)
6+
set_target_properties(TextInclude1Test2 PROPERTIES LINK_SEARCH_END_STATIC 1)
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// TextInclude1Test2.cpp
2+
// Test case for TEXTINCLUDE 1 support (Issue #301)
3+
//////////////////////////////////////////////////////////////////////////////
4+
5+
#include <windows.h>
6+
#include <windowsx.h>
7+
#include <commctrl.h>
8+
#include <tchar.h>
9+
#include "include/custom_resource.h"
10+
11+
#ifdef _MSC_VER
12+
#pragma comment(linker,"/manifestdependency:\"type='win32' \
13+
name='Microsoft.Windows.Common-Controls' \
14+
version='6.0.0.0' \
15+
processorArchitecture='*' \
16+
publicKeyToken='6595b64144ccf1df' \
17+
language='*'\"")
18+
#endif
19+
20+
//////////////////////////////////////////////////////////////////////////////
21+
22+
BOOL OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
23+
{
24+
return TRUE;
25+
}
26+
27+
void OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
28+
{
29+
switch (id)
30+
{
31+
case IDC_BTN_OK:
32+
case IDOK:
33+
EndDialog(hwnd, IDOK);
34+
break;
35+
case IDC_BTN_CANCEL:
36+
case IDCANCEL:
37+
EndDialog(hwnd, IDCANCEL);
38+
break;
39+
}
40+
}
41+
42+
INT_PTR CALLBACK
43+
DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
44+
{
45+
switch (uMsg)
46+
{
47+
HANDLE_MSG(hwnd, WM_INITDIALOG, OnInitDialog);
48+
HANDLE_MSG(hwnd, WM_COMMAND, OnCommand);
49+
}
50+
return 0;
51+
}
52+
53+
//////////////////////////////////////////////////////////////////////////////
54+
55+
extern "C" INT WINAPI
56+
_tWinMain(HINSTANCE hInstance,
57+
HINSTANCE hPrevInstance,
58+
LPTSTR lpCmdLine,
59+
INT nCmdShow)
60+
{
61+
InitCommonControls();
62+
DialogBox(hInstance, MAKEINTRESOURCE(IDD_MAIN), NULL, DialogProc);
63+
return 0;
64+
}
65+
66+
//////////////////////////////////////////////////////////////////////////////
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// TextInclude1Test2_res.rc
2+
// Test case for TEXTINCLUDE 1 support (Issue #301)
3+
// This file uses a custom header file name in TEXTINCLUDE 1.
4+
// † <-- This dagger helps UTF-8 detection.
5+
6+
#include "include\\custom_resource.h"
7+
8+
#define APSTUDIO_HIDDEN_SYMBOLS
9+
#include <windows.h>
10+
#include <commctrl.h>
11+
#undef APSTUDIO_HIDDEN_SYMBOLS
12+
#pragma code_page(65001) // UTF-8
13+
14+
//////////////////////////////////////////////////////////////////////////////
15+
16+
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
17+
18+
//////////////////////////////////////////////////////////////////////////////
19+
// RT_DIALOG
20+
21+
IDD_MAIN DIALOG 0, 0, 215, 100
22+
CAPTION "TextInclude1Test2"
23+
STYLE DS_MODALFRAME | WS_POPUPWINDOW | WS_CAPTION
24+
FONT 9, "Arial"
25+
{
26+
DEFPUSHBUTTON "OK", IDC_BTN_OK, 35, 80, 60, 14
27+
PUSHBUTTON "Cancel", IDC_BTN_CANCEL, 115, 80, 60, 14
28+
}
29+
30+
//////////////////////////////////////////////////////////////////////////////
31+
// TEXTINCLUDE
32+
33+
#ifdef APSTUDIO_INVOKED
34+
35+
1 TEXTINCLUDE
36+
BEGIN
37+
"include\\custom_resource.h\0"
38+
END
39+
40+
2 TEXTINCLUDE
41+
BEGIN
42+
"#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
43+
"#include <windows.h>\r\n"
44+
"#include <commctrl.h>\r\n"
45+
"#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
46+
"\0"
47+
END
48+
49+
3 TEXTINCLUDE
50+
BEGIN
51+
"\r\n"
52+
"\0"
53+
END
54+
55+
#endif // APSTUDIO_INVOKED
56+
57+
//////////////////////////////////////////////////////////////////////////////
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "..\\resource.h"

tests/TextInclude1Test2/resource.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// custom_resource.h - Custom header file for TEXTINCLUDE 1 testing
2+
// Issue #301: Support TEXTINCLUDE 1
3+
4+
#define IDD_MAIN 1
5+
#define IDC_BTN_OK 100
6+
#define IDC_BTN_CANCEL 101

0 commit comments

Comments
 (0)