Skip to content

Commit 6742afb

Browse files
authored
Merge pull request #15 from chcg/X64
X64
2 parents df26c3d + 6b2aa60 commit 6742afb

25 files changed

+1382
-1255
lines changed

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
*.sdf
2+
*.sln
3+
*.suo
4+
*.obj
5+
*.tlog
6+
*.dll
7+
*.lib
8+
*.exp
9+
NppJSONViewer/Debug
10+
NppJSONViewer/Release
11+
NppJSONViewer/x64
12+
NppJSONViewer/NppJSONViewer.vcxproj.user
13+
*.aps
14+
*.zip

NppJSONViewer/DockingDlgInterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class DockingDlgInterface : public StaticDialog
7272
};
7373

7474
protected :
75-
virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
75+
virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM /*wParam*/, LPARAM lParam)
7676
{
7777
switch (message)
7878
{

NppJSONViewer/Hyperlinks.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ LRESULT CALLBACK _HyperlinkParentProc(HWND hwnd, UINT message, WPARAM wParam, LP
4040
}
4141
case WM_DESTROY:
4242
{
43-
SetWindowLong(hwnd, GWL_WNDPROC, (LONG) pfnOrigProc);
43+
SetWindowLongPtr(hwnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(pfnOrigProc));
4444
RemoveProp(hwnd, PROP_ORIGINAL_PROC);
4545
break;
4646
}
@@ -56,7 +56,7 @@ LRESULT CALLBACK _HyperlinkProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
5656
{
5757
case WM_DESTROY:
5858
{
59-
SetWindowLong(hwnd, GWL_WNDPROC, (LONG) pfnOrigProc);
59+
SetWindowLongPtr(hwnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(pfnOrigProc));
6060
RemoveProp(hwnd, PROP_ORIGINAL_PROC);
6161

6262
HFONT hOrigFont = (HFONT) GetProp(hwnd, PROP_ORIGINAL_FONT);
@@ -102,10 +102,10 @@ LRESULT CALLBACK _HyperlinkProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
102102
{
103103
// Since IDC_HAND is not available on all operating systems,
104104
// we will load the arrow cursor if IDC_HAND is not present.
105-
HCURSOR hCursor = LoadCursor(NULL, MAKEINTRESOURCE(IDC_HAND));
105+
HCURSOR hCursor = LoadCursor(NULL, IDC_HAND);
106106
if (NULL == hCursor)
107107
{
108-
hCursor = LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW));
108+
hCursor = LoadCursor(NULL, IDC_ARROW);
109109
}
110110
SetCursor(hCursor);
111111
return TRUE;
@@ -122,24 +122,24 @@ BOOL ConvertStaticToHyperlink(HWND hwndCtl)
122122
HWND hwndParent = GetParent(hwndCtl);
123123
if (NULL != hwndParent)
124124
{
125-
WNDPROC pfnOrigProc = (WNDPROC) GetWindowLong(hwndParent, GWL_WNDPROC);
125+
WNDPROC pfnOrigProc = (WNDPROC) GetWindowLongPtr(hwndParent, GWLP_WNDPROC);
126126
if (pfnOrigProc != _HyperlinkParentProc)
127127
{
128128
SetProp(hwndParent, PROP_ORIGINAL_PROC, (HANDLE) pfnOrigProc);
129-
SetWindowLong(hwndParent, GWL_WNDPROC, (LONG) (WNDPROC) _HyperlinkParentProc);
129+
SetWindowLongPtr(hwndParent, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(_HyperlinkParentProc));
130130
}
131131
}
132132

133133
// Make sure the control will send notifications.
134134

135-
DWORD dwStyle = GetWindowLong(hwndCtl, GWL_STYLE);
136-
SetWindowLong(hwndCtl, GWL_STYLE, dwStyle | SS_NOTIFY);
135+
LONG_PTR dwStyle = GetWindowLongPtr(hwndCtl, GWL_STYLE);
136+
SetWindowLongPtr(hwndCtl, GWL_STYLE, dwStyle | SS_NOTIFY);
137137

138138
// Subclass the existing control.
139139

140-
WNDPROC pfnOrigProc = (WNDPROC) GetWindowLong(hwndCtl, GWL_WNDPROC);
140+
WNDPROC pfnOrigProc = (WNDPROC)GetWindowLongPtr(hwndCtl, GWLP_WNDPROC);
141141
SetProp(hwndCtl, PROP_ORIGINAL_PROC, (HANDLE) pfnOrigProc);
142-
SetWindowLong(hwndCtl, GWL_WNDPROC, (LONG) (WNDPROC) _HyperlinkProc);
142+
SetWindowLongPtr(hwndCtl, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(_HyperlinkProc));
143143

144144
// Create an updated font by adding an underline.
145145

NppJSONViewer/JSONDialog.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void JSONDialog::setJSON(char* json)
8080

8181
void JSONDialog::populateTree (HWND hWndDlg, HTREEITEM tree_root, json_t * json_root, int level)
8282
{
83-
HTREEITEM newItem;
83+
HTREEITEM newItem = NULL;
8484
switch (json_root->type)
8585
{
8686
case JSON_STRING:
@@ -281,7 +281,10 @@ void JSONDialog::populateTree (HWND hWndDlg, HTREEITEM tree_root, json_t * json_
281281

282282
while (ita != NULL)
283283
{
284-
populateTree(hWndDlg,newItem,ita, level + 1);
284+
if (newItem)
285+
{
286+
populateTree(hWndDlg, newItem, ita, level + 1);
287+
}
285288
ita = ita->next;
286289
}
287290
}
@@ -344,7 +347,7 @@ void JSONDialog::drawTree()
344347
}
345348
}
346349

347-
BOOL CALLBACK JSONDialog::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
350+
INT_PTR CALLBACK JSONDialog::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
348351
{
349352
int width,height;
350353
switch (message)

NppJSONViewer/JSONDialog.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2222

2323
#include "DockingDlgInterface.h"
2424
#include "PluginInterface.h"
25+
#include <commctrl.h>
26+
#include "resource.h"
2527
#include "json.h"
2628

2729
class JSONDialog : public DockingDlgInterface
@@ -46,7 +48,7 @@ public :
4648
void setJSON(char *json);
4749

4850
protected :
49-
virtual BOOL CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
51+
virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
5052
};
5153

5254
#endif //JSONDIALOG_H

NppJSONViewer/NPPJSONViewer.sln

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11

2-
Microsoft Visual Studio Solution File, Format Version 11.00
3-
# Visual C++ Express 2010
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
46
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NPPJSONViewer", "NPPJSONViewer.vcxproj", "{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}"
57
EndProject
68
Global
79
GlobalSection(SolutionConfigurationPlatforms) = preSolution
8-
ANSI Debug|Win32 = ANSI Debug|Win32
9-
ANSI Release|Win32 = ANSI Release|Win32
10-
Unicode Debug|Win32 = Unicode Debug|Win32
11-
Unicode Realeas|Win32 = Unicode Realeas|Win32
10+
Debug|x64 = Debug|x64
11+
Debug|Win32 = Debug|Win32
12+
Release|x64 = Release|x64
13+
Release|Win32 = Release|Win32
1214
EndGlobalSection
1315
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14-
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.ANSI Debug|Win32.ActiveCfg = Unicode Release|Win32
15-
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.ANSI Debug|Win32.Build.0 = Unicode Release|Win32
16-
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.ANSI Release|Win32.ActiveCfg = ANSI Release|Win32
17-
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.ANSI Release|Win32.Build.0 = ANSI Release|Win32
18-
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Unicode Debug|Win32.ActiveCfg = Unicode Release|Win32
19-
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Unicode Debug|Win32.Build.0 = Unicode Release|Win32
20-
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Unicode Realeas|Win32.ActiveCfg = Unicode Release|Win32
21-
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Unicode Realeas|Win32.Build.0 = Unicode Release|Win32
16+
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Debug|x64.ActiveCfg = Debug|x64
17+
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Debug|x64.Build.0 = Debug|x64
18+
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Debug|Win32.ActiveCfg = Debug|Win32
19+
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Debug|Win32.Build.0 = Debug|Win32
20+
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|x64.ActiveCfg = Release|x64
21+
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|x64.Build.0 = Release|x64
22+
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|Win32.ActiveCfg = Release|Win32
23+
{1590D7CD-7D3A-4AB7-A355-EE02F7FB987D}.Release|Win32.Build.0 = Release|Win32
2224
EndGlobalSection
2325
GlobalSection(SolutionProperties) = preSolution
2426
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)