Upgrade code for 64-bit build in Visual Studio.

pull/421/head
Dmitry Brant 2017-04-08 16:51:31 -04:00 committed by Hleb Valoshka
parent ae31662a96
commit ac3c5b25fe
11 changed files with 99 additions and 96 deletions

View File

@ -13,7 +13,7 @@
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>

View File

@ -292,10 +292,11 @@ BOOL APIENTRY EclipseListViewProc(HWND hWnd,
BOOL APIENTRY EclipseFinderProc(HWND hDlg,
UINT message,
UINT wParam,
LONG lParam)
WPARAM wParam,
LPARAM lParam)
{
EclipseFinderDialog* eclipseFinderDlg = reinterpret_cast<EclipseFinderDialog*>(GetWindowLong(hDlg, DWL_USER));
//EclipseFinderDialog* eclipseFinderDlg = reinterpret_cast<EclipseFinderDialog*>(GetWindowLong(hDlg, DWL_USER));
EclipseFinderDialog* eclipseFinderDlg = reinterpret_cast<EclipseFinderDialog*>(GetWindowLongPtr(hDlg, DWLP_USER));
switch (message)
{
@ -304,7 +305,8 @@ BOOL APIENTRY EclipseFinderProc(HWND hDlg,
EclipseFinderDialog* efd = reinterpret_cast<EclipseFinderDialog*>(lParam);
if (efd == NULL)
return EndDialog(hDlg, 0);
SetWindowLong(hDlg, DWL_USER, lParam);
//SetWindowLong(hDlg, DWL_USER, lParam);
SetWindowLongPtr(hDlg, DWLP_USER, lParam);
HWND hwnd = GetDlgItem(hDlg, IDC_ECLIPSES_LIST);
InitEclipseFinderColumns(hwnd);
SendDlgItemMessage(hDlg, IDC_ECLIPSES_LIST, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT);
@ -328,7 +330,8 @@ BOOL APIENTRY EclipseFinderProc(HWND hDlg,
// Subclass the ListView to intercept WM_LBUTTONUP messages
HWND hCtrl;
if (hCtrl = GetDlgItem(hDlg, IDC_ECLIPSES_LIST))
oldListViewProc = (WNDPROC) SetWindowLong(hCtrl, GWL_WNDPROC, (DWORD) EclipseListViewProc);
oldListViewProc = (WNDPROC)SetWindowLongPtr(hCtrl, GWLP_WNDPROC, (LPARAM)EclipseListViewProc);
//oldListViewProc = (WNDPROC) SetWindowLong(hCtrl, GWL_WNDPROC, (DWORD) EclipseListViewProc);
}
return(TRUE);
@ -515,6 +518,6 @@ EclipseFinderDialog::EclipseFinderDialog(HINSTANCE appInstance,
hwnd = CreateDialogParam(appInstance,
MAKEINTRESOURCE(IDD_ECLIPSEFINDER),
parent,
EclipseFinderProc,
reinterpret_cast<LONG>(this));
(DLGPROC)EclipseFinderProc,
reinterpret_cast<LPARAM>(this));
}

View File

@ -41,10 +41,10 @@ static bool SetDialogFloat(HWND hDlg, int id, char* format, float f)
static BOOL APIENTRY GotoObjectProc(HWND hDlg,
UINT message,
UINT wParam,
LONG lParam)
WPARAM wParam,
LPARAM lParam)
{
GotoObjectDialog* gotoDlg = reinterpret_cast<GotoObjectDialog*>(GetWindowLong(hDlg, DWL_USER));
GotoObjectDialog* gotoDlg = reinterpret_cast<GotoObjectDialog*>(GetWindowLongPtr(hDlg, DWLP_USER));
switch (message)
{
@ -53,7 +53,7 @@ static BOOL APIENTRY GotoObjectProc(HWND hDlg,
GotoObjectDialog* gotoDlg = reinterpret_cast<GotoObjectDialog*>(lParam);
if (gotoDlg == NULL)
return EndDialog(hDlg, 0);
SetWindowLong(hDlg, DWL_USER, lParam);
SetWindowLongPtr(hDlg, DWLP_USER, lParam);
CheckRadioButton(hDlg,
IDC_RADIO_KM, IDC_RADIO_RADII,
IDC_RADIO_KM);
@ -172,6 +172,6 @@ GotoObjectDialog::GotoObjectDialog(HINSTANCE appInstance,
hwnd = CreateDialogParam(appInstance,
MAKEINTRESOURCE(IDD_GOTO_OBJECT),
parent,
GotoObjectProc,
reinterpret_cast<LONG>(this));
(DLGPROC)GotoObjectProc,
reinterpret_cast<LPARAM>(this));
}

View File

@ -76,7 +76,7 @@ LRESULT CALLBACK _HyperlinkParentProc(HWND hWnd, UINT message, WPARAM wParam, LP
}
case WM_DESTROY:
{
SetWindowLong(hWnd, GWL_WNDPROC, (LONG)origProc);
SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)origProc);
RemoveProp(hWnd, hyperLinkOriginalProc);
break;
}
@ -131,7 +131,7 @@ LRESULT CALLBACK _HyperlinkProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
}
case WM_DESTROY:
{
SetWindowLong(hWnd, GWL_WNDPROC, (LONG)origProc);
SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)origProc);
RemoveProp(hWnd, hyperLinkOriginalProc);
HFONT hOrigFont = (HFONT)GetProp(hWnd, hyperLinkOriginalFont);
@ -162,11 +162,11 @@ BOOL MakeHyperlinkFromStaticCtrl(HWND hDlg, UINT ctrlID)
HWND hParent = GetParent(hCtrl);
if (hParent)
{
WNDPROC origProc = (WNDPROC)GetWindowLong(hParent, GWL_WNDPROC);
WNDPROC origProc = (WNDPROC)GetWindowLongPtr(hParent, GWLP_WNDPROC);
if (origProc != _HyperlinkParentProc)
{
SetProp(hParent, hyperLinkOriginalProc, (HANDLE)origProc);
SetWindowLong(hParent, GWL_WNDPROC, (LONG)(WNDPROC)_HyperlinkParentProc);
SetWindowLong(hParent, GWLP_WNDPROC, (LONG_PTR)(WNDPROC)_HyperlinkParentProc);
}
}
@ -175,9 +175,9 @@ BOOL MakeHyperlinkFromStaticCtrl(HWND hDlg, UINT ctrlID)
SetWindowLong(hCtrl, GWL_STYLE, dwStyle | SS_NOTIFY);
// Subclass the existing control.
WNDPROC origProc = (WNDPROC)GetWindowLong(hCtrl, GWL_WNDPROC);
WNDPROC origProc = (WNDPROC)GetWindowLongPtr(hCtrl, GWLP_WNDPROC);
SetProp(hCtrl, hyperLinkOriginalProc, (HANDLE)origProc);
SetWindowLong(hCtrl, GWL_WNDPROC, (LONG)(WNDPROC)_HyperlinkProc);
SetWindowLong(hCtrl, GWLP_WNDPROC, (LONG_PTR)(WNDPROC)_HyperlinkProc);
// Create an updated font by adding an underline.
HFONT hOrigFont = (HFONT) SendMessage(hCtrl, WM_GETFONT, 0, 0);

View File

@ -31,10 +31,10 @@ static const uint32 FilterOther = ~(Location::City |
static BOOL APIENTRY LocationsProc(HWND hDlg,
UINT message,
UINT wParam,
LONG lParam)
WPARAM wParam,
LPARAM lParam)
{
LocationsDialog* dlg = reinterpret_cast<LocationsDialog*>(GetWindowLong(hDlg, DWL_USER));
LocationsDialog* dlg = reinterpret_cast<LocationsDialog*>(GetWindowLongPtr(hDlg, DWLP_USER));
switch (message)
{
@ -43,7 +43,7 @@ static BOOL APIENTRY LocationsProc(HWND hDlg,
dlg = reinterpret_cast<LocationsDialog*>(lParam);
if (dlg == NULL)
return EndDialog(hDlg, 0);
SetWindowLong(hDlg, DWL_USER, lParam);
SetWindowLongPtr(hDlg, DWLP_USER, lParam);
// Store original settings in case user cancels the dialog
// dlg->initialLocationFlags = dlg->appCore->getSimulation()->getActiveObserver();
@ -167,8 +167,8 @@ LocationsDialog::LocationsDialog(HINSTANCE appInstance,
hwnd = CreateDialogParam(appInstance,
MAKEINTRESOURCE(IDD_LOCATIONS),
parent,
LocationsProc,
reinterpret_cast<LONG>(this));
(DLGPROC)LocationsProc,
reinterpret_cast<LPARAM>(this));
}

View File

@ -526,8 +526,8 @@ bool LoadItemTextFromFile(HWND hWnd,
BOOL APIENTRY AboutProc(HWND hDlg,
UINT message,
UINT wParam,
LONG lParam)
WPARAM wParam,
LPARAM lParam)
{
switch (message)
{
@ -563,8 +563,8 @@ BOOL APIENTRY AboutProc(HWND hDlg,
BOOL APIENTRY ControlsHelpProc(HWND hDlg,
UINT message,
UINT wParam,
LONG lParam)
WPARAM wParam,
LPARAM lParam)
{
switch (message)
{
@ -587,8 +587,8 @@ BOOL APIENTRY ControlsHelpProc(HWND hDlg,
BOOL APIENTRY LicenseProc(HWND hDlg,
UINT message,
UINT wParam,
LONG lParam)
WPARAM wParam,
LPARAM lParam)
{
switch (message)
{
@ -611,8 +611,8 @@ BOOL APIENTRY LicenseProc(HWND hDlg,
BOOL APIENTRY GLInfoProc(HWND hDlg,
UINT message,
UINT wParam,
LONG lParam)
WPARAM wParam,
LPARAM lParam)
{
switch (message)
{
@ -779,8 +779,8 @@ UINT CALLBACK ChooseMovieParamsProc(HWND hDlg, UINT message,
BOOL APIENTRY FindObjectProc(HWND hDlg,
UINT message,
UINT wParam,
LONG lParam)
WPARAM wParam,
LPARAM lParam)
{
switch (message)
{
@ -818,8 +818,8 @@ BOOL APIENTRY FindObjectProc(HWND hDlg,
BOOL APIENTRY AddBookmarkFolderProc(HWND hDlg,
UINT message,
UINT wParam,
LONG lParam)
WPARAM wParam,
LPARAM lParam)
{
switch (message)
{
@ -909,8 +909,8 @@ BOOL APIENTRY AddBookmarkFolderProc(HWND hDlg,
BOOL APIENTRY AddBookmarkProc(HWND hDlg,
UINT message,
UINT wParam,
LONG lParam)
WPARAM wParam,
LPARAM lParam)
{
switch (message)
{
@ -1077,7 +1077,7 @@ BOOL APIENTRY AddBookmarkProc(HWND hDlg,
if(hBookmarkTree = GetDlgItem(hDlg, IDC_BOOKMARK_FOLDERTREE))
{
DialogBox(hRes, MAKEINTRESOURCE(IDD_ADDBOOKMARK_FOLDER),
hDlg, AddBookmarkFolderProc);
hDlg, (DLGPROC)AddBookmarkFolderProc);
}
}
break;
@ -1089,8 +1089,8 @@ BOOL APIENTRY AddBookmarkProc(HWND hDlg,
BOOL APIENTRY RenameBookmarkProc(HWND hDlg,
UINT message,
UINT wParam,
LONG lParam)
WPARAM wParam,
LPARAM lParam)
{
switch (message)
{
@ -1173,8 +1173,8 @@ BOOL APIENTRY RenameBookmarkProc(HWND hDlg,
BOOL APIENTRY OrganizeBookmarksProc(HWND hDlg,
UINT message,
UINT wParam,
LONG lParam)
WPARAM wParam,
LPARAM lParam)
{
static UINT_PTR dragDropTimer;
switch (message)
@ -1230,7 +1230,7 @@ BOOL APIENTRY OrganizeBookmarksProc(HWND hDlg,
{
if (hBookmarkTree = GetDlgItem(hDlg, IDC_ORGANIZE_BOOKMARK_TREE))
{
DialogBox(hRes, MAKEINTRESOURCE(IDD_ADDBOOKMARK_FOLDER), hDlg, AddBookmarkFolderProc);
DialogBox(hRes, MAKEINTRESOURCE(IDD_ADDBOOKMARK_FOLDER), hDlg, (DLGPROC)AddBookmarkFolderProc);
}
}
else if (LOWORD(wParam) == IDC_ORGANIZE_BOOKMARKS_RENAME)
@ -1249,7 +1249,7 @@ BOOL APIENTRY OrganizeBookmarksProc(HWND hDlg,
{
DialogBox(hRes,
MAKEINTRESOURCE(IDD_RENAME_BOOKMARK),
hDlg, RenameBookmarkProc);
hDlg, (DLGPROC)RenameBookmarkProc);
}
}
}
@ -1371,8 +1371,8 @@ BOOL APIENTRY OrganizeBookmarksProc(HWND hDlg,
int selectedScreenMode = 0;
BOOL APIENTRY SelectDisplayModeProc(HWND hDlg,
UINT message,
UINT wParam,
LONG lParam)
WPARAM wParam,
LPARAM lParam)
{
switch (message)
{
@ -1559,7 +1559,7 @@ static HMENU CreatePlanetarySystemMenu(string parentName, const PlanetarySystem*
for(it=obj->begin(); it != obj->end(); it++)
AppendMenu(hSubMenu, MF_STRING, MENU_CHOOSE_PLANET + it->first, it->second.c_str());
AppendMenu(menu, MF_POPUP | MF_STRING, (DWORD)hSubMenu, menuName->c_str());
AppendMenu(menu, MF_POPUP | MF_STRING, (UINT_PTR)hSubMenu, menuName->c_str());
}
else
{
@ -1611,7 +1611,7 @@ VOID APIENTRY handlePopupMenu(HWND hwnd,
AppendMenu(hMenu, MF_STRING, ID_NAVIGATION_SYNCORBIT, UTF8ToCurrentCP(_("S&ync Orbit")).c_str());
AppendMenu(hMenu, MF_STRING, ID_INFO, UTF8ToCurrentCP(_("&Info")).c_str());
HMENU refVectorMenu = CreatePopupMenu();
AppendMenu(hMenu, MF_POPUP | MF_STRING, (DWORD) refVectorMenu, UTF8ToCurrentCP(_("&Reference Marks")).c_str());
AppendMenu(hMenu, MF_POPUP | MF_STRING, (UINT_PTR) refVectorMenu, UTF8ToCurrentCP(_("&Reference Marks")).c_str());
AppendMenu(refVectorMenu, MF_STRING, ID_RENDER_BODY_AXES, UTF8ToCurrentCP(_("Show Body Axes")).c_str());
AppendMenu(refVectorMenu, MF_STRING, ID_RENDER_FRAME_AXES, UTF8ToCurrentCP(_("Show Frame Axes")).c_str());
AppendMenu(refVectorMenu, MF_STRING, ID_RENDER_SUN_DIRECTION, UTF8ToCurrentCP(_("Show Sun Direction")).c_str());
@ -1630,7 +1630,7 @@ VOID APIENTRY handlePopupMenu(HWND hwnd,
if (satellites != NULL && satellites->getSystemSize() != 0)
{
HMENU satMenu = CreatePlanetarySystemMenu(name, satellites);
AppendMenu(hMenu, MF_POPUP | MF_STRING, (DWORD) satMenu,
AppendMenu(hMenu, MF_POPUP | MF_STRING, (UINT_PTR) satMenu,
UTF8ToCurrentCP(_("&Satellites")).c_str());
}
@ -1640,7 +1640,7 @@ VOID APIENTRY handlePopupMenu(HWND hwnd,
if (altSurfaces->size() != NULL)
{
HMENU surfMenu = CreateAlternateSurfaceMenu(*altSurfaces);
AppendMenu(hMenu, MF_POPUP | MF_STRING, (DWORD) surfMenu,
AppendMenu(hMenu, MF_POPUP | MF_STRING, (UINT_PTR) surfMenu,
UTF8ToCurrentCP(_("&Alternate Surfaces")).c_str());
}
delete altSurfaces;
@ -1664,9 +1664,9 @@ VOID APIENTRY handlePopupMenu(HWND hwnd,
SolarSystem* solarSys = iter->second;
HMENU planetsMenu = CreatePlanetarySystemMenu(name, solarSys->getPlanets());
if (name == "Sol")
AppendMenu(hMenu, MF_POPUP | MF_STRING, (DWORD) planetsMenu, UTF8ToCurrentCP(_("Orbiting Bodies")).c_str());
AppendMenu(hMenu, MF_POPUP | MF_STRING, (UINT_PTR) planetsMenu, UTF8ToCurrentCP(_("Orbiting Bodies")).c_str());
else
AppendMenu(hMenu, MF_POPUP | MF_STRING, (DWORD) planetsMenu, UTF8ToCurrentCP(_("Planets")).c_str());
AppendMenu(hMenu, MF_POPUP | MF_STRING, (UINT_PTR) planetsMenu, UTF8ToCurrentCP(_("Planets")).c_str());
}
}
break;
@ -2739,7 +2739,7 @@ static void HandleCaptureMovie(HWND hWnd)
Ofn.hInstance = appInstance;
Ofn.lpTemplateName = MAKEINTRESOURCE(IDD_MOVIE_PARAMS_CHOOSER);
Ofn.lpfnHook = ChooseMovieParamsProc;
Ofn.lpfnHook = (LPOFNHOOKPROC)ChooseMovieParamsProc;
// Display the Save dialog box.
if (GetSaveFileName(&Ofn))
@ -3983,7 +3983,7 @@ LRESULT CALLBACK MainWindowProc(HWND hWnd,
appCore->charEntered('H');
break;
case ID_NAVIGATION_SELECT:
DialogBox(hRes, MAKEINTRESOURCE(IDD_FINDOBJECT), hWnd, FindObjectProc);
DialogBox(hRes, MAKEINTRESOURCE(IDD_FINDOBJECT), hWnd, (DLGPROC)FindObjectProc);
break;
case ID_NAVIGATION_GOTO_OBJECT:
if (gotoObjectDlg == NULL)
@ -4059,7 +4059,7 @@ LRESULT CALLBACK MainWindowProc(HWND hWnd,
CreateDialogParam(hRes,
MAKEINTRESOURCE(IDD_DISPLAYMODE),
hWnd,
SelectDisplayModeProc,
(DLGPROC)SelectDisplayModeProc,
NULL);
break;
@ -4234,11 +4234,11 @@ LRESULT CALLBACK MainWindowProc(HWND hWnd,
break;
case ID_BOOKMARKS_ADDBOOKMARK:
DialogBox(hRes, MAKEINTRESOURCE(IDD_ADDBOOKMARK), hWnd, AddBookmarkProc);
DialogBox(hRes, MAKEINTRESOURCE(IDD_ADDBOOKMARK), hWnd, (DLGPROC)AddBookmarkProc);
break;
case ID_BOOKMARKS_ORGANIZE:
DialogBox(hRes, MAKEINTRESOURCE(IDD_ORGANIZE_BOOKMARKS), hWnd, OrganizeBookmarksProc);
DialogBox(hRes, MAKEINTRESOURCE(IDD_ORGANIZE_BOOKMARKS), hWnd, (DLGPROC)OrganizeBookmarksProc);
break;
case ID_HELP_RUNDEMO:
@ -4254,20 +4254,20 @@ LRESULT CALLBACK MainWindowProc(HWND hWnd,
CreateDialogParam(hRes,
MAKEINTRESOURCE(IDD_CONTROLSHELP),
hWnd,
ControlsHelpProc,
(DLGPROC)ControlsHelpProc,
NULL);
break;
case ID_HELP_ABOUT:
DialogBox(hRes, MAKEINTRESOURCE(IDD_ABOUT), hWnd, AboutProc);
DialogBox(hRes, MAKEINTRESOURCE(IDD_ABOUT), hWnd, (DLGPROC)AboutProc);
break;
case ID_HELP_GLINFO:
DialogBox(hRes, MAKEINTRESOURCE(IDD_GLINFO), hWnd, GLInfoProc);
DialogBox(hRes, MAKEINTRESOURCE(IDD_GLINFO), hWnd, (DLGPROC)GLInfoProc);
break;
case ID_HELP_LICENSE:
DialogBox(hRes, MAKEINTRESOURCE(IDD_LICENSE), hWnd, LicenseProc);
DialogBox(hRes, MAKEINTRESOURCE(IDD_LICENSE), hWnd, (DLGPROC)LicenseProc);
break;
case ID_INFO:

View File

@ -93,10 +93,10 @@ void AddPlanetarySystemToTree(const PlanetarySystem* sys, HWND treeView, int lev
BOOL APIENTRY SolarSystemBrowserProc(HWND hDlg,
UINT message,
UINT wParam,
LONG lParam)
WPARAM wParam,
LPARAM lParam)
{
SolarSystemBrowser* browser = reinterpret_cast<SolarSystemBrowser*>(GetWindowLong(hDlg, DWL_USER));
SolarSystemBrowser* browser = reinterpret_cast<SolarSystemBrowser*>(GetWindowLongPtr(hDlg, DWLP_USER));
switch (message)
{
@ -105,7 +105,7 @@ BOOL APIENTRY SolarSystemBrowserProc(HWND hDlg,
SolarSystemBrowser* browser = reinterpret_cast<SolarSystemBrowser*>(lParam);
if (browser == NULL)
return EndDialog(hDlg, 0);
SetWindowLong(hDlg, DWL_USER, lParam);
SetWindowLongPtr(hDlg, DWLP_USER, lParam);
HWND hwnd = GetDlgItem(hDlg, IDC_SSBROWSER_TREE);
const SolarSystem* solarSys = browser->appCore->getSimulation()->getNearestSolarSystem();
@ -190,12 +190,12 @@ SolarSystemBrowser::SolarSystemBrowser(HINSTANCE appInstance,
hwnd = CreateDialogParam(appInstance,
MAKEINTRESOURCE(IDD_SSBROWSER),
parent,
SolarSystemBrowserProc,
reinterpret_cast<LONG>(this));
(DLGPROC)SolarSystemBrowserProc,
reinterpret_cast<LONG_PTR>(this));
}
SolarSystemBrowser::~SolarSystemBrowser()
{
SetWindowLong(hwnd, DWL_USER, 0);
SetWindowLongPtr(hwnd, DWLP_USER, 0);
}

View File

@ -257,7 +257,7 @@ bool InitStarBrowserItems(HWND listView, StarBrowser* browser)
solarSysPred.pos = browser->pos;
solarSysPred.solarSystems = solarSystems;
stars = FindStars(*stardb, solarSysPred,
min((unsigned int) browser->nStars, solarSystems->size()));
min((unsigned int) browser->nStars, (unsigned int) solarSystems->size()));
}
break;
@ -398,10 +398,10 @@ void RefreshItems(HWND hDlg, StarBrowser* browser)
BOOL APIENTRY StarBrowserProc(HWND hDlg,
UINT message,
UINT wParam,
LONG lParam)
WPARAM wParam,
LPARAM lParam)
{
StarBrowser* browser = reinterpret_cast<StarBrowser*>(GetWindowLong(hDlg, DWL_USER));
StarBrowser* browser = reinterpret_cast<StarBrowser*>(GetWindowLongPtr(hDlg, DWLP_USER));
switch (message)
{
@ -410,7 +410,7 @@ BOOL APIENTRY StarBrowserProc(HWND hDlg,
StarBrowser* browser = reinterpret_cast<StarBrowser*>(lParam);
if (browser == NULL)
return EndDialog(hDlg, 0);
SetWindowLong(hDlg, DWL_USER, lParam);
SetWindowLongPtr(hDlg, DWLP_USER, lParam);
HWND hwnd = GetDlgItem(hDlg, IDC_STARBROWSER_LIST);
InitStarBrowserColumns(hwnd);
@ -613,12 +613,12 @@ StarBrowser::StarBrowser(HINSTANCE appInstance,
hwnd = CreateDialogParam(appInstance,
MAKEINTRESOURCE(IDD_STARBROWSER),
parent,
StarBrowserProc,
reinterpret_cast<LONG>(this));
(DLGPROC)StarBrowserProc,
reinterpret_cast<LONG_PTR>(this));
}
StarBrowser::~StarBrowser()
{
SetWindowLong(hwnd, DWL_USER, 0);
SetWindowLongPtr(hwnd, DWLP_USER, 0);
}

View File

@ -84,7 +84,7 @@ SetTimeDialog::init(HWND _hDlg)
{
hDlg = _hDlg;
SetWindowLong(hDlg, DWL_USER, reinterpret_cast<LPARAM>(this));
SetWindowLongPtr(hDlg, DWLP_USER, reinterpret_cast<LPARAM>(this));
getLocalTimeZoneInfo();
tdb = appCore->getSimulation()->getTime();
@ -292,10 +292,10 @@ SetTimeDialog::notify(int id, const NMHDR& hdr)
static BOOL APIENTRY
SetTimeProc(HWND hDlg,
UINT message,
UINT wParam,
LONG lParam)
WPARAM wParam,
LPARAM lParam)
{
SetTimeDialog* timeDialog = reinterpret_cast<SetTimeDialog*>(GetWindowLong(hDlg, DWL_USER));
SetTimeDialog* timeDialog = reinterpret_cast<SetTimeDialog*>(GetWindowLongPtr(hDlg, DWLP_USER));
switch (message)
{
@ -327,7 +327,7 @@ ShowSetTimeDialog(HINSTANCE appInstance,
{
SetTimeDialog* timeDialog = new SetTimeDialog(appCore);
DialogBoxParam(appInstance, MAKEINTRESOURCE(IDD_SETTIME), appWindow, SetTimeProc, reinterpret_cast<LPARAM>(timeDialog));
DialogBoxParam(appInstance, MAKEINTRESOURCE(IDD_SETTIME), appWindow, (DLGPROC)SetTimeProc, reinterpret_cast<LPARAM>(timeDialog));
delete timeDialog;
}

View File

@ -26,10 +26,10 @@ using namespace std;
BOOL APIENTRY TourGuideProc(HWND hDlg,
UINT message,
UINT wParam,
LONG lParam)
WPARAM wParam,
LPARAM lParam)
{
TourGuide* tourGuide = reinterpret_cast<TourGuide*>(GetWindowLong(hDlg, DWL_USER));
TourGuide* tourGuide = reinterpret_cast<TourGuide*>(GetWindowLongPtr(hDlg, DWLP_USER));
switch (message)
{
@ -38,7 +38,7 @@ BOOL APIENTRY TourGuideProc(HWND hDlg,
TourGuide* guide = reinterpret_cast<TourGuide*>(lParam);
if (guide == NULL)
return EndDialog(hDlg, 0);
SetWindowLong(hDlg, DWL_USER, lParam);
SetWindowLongPtr(hDlg, DWLP_USER, lParam);
guide->selectedDest = NULL;
@ -148,6 +148,6 @@ TourGuide::TourGuide(HINSTANCE appInstance,
hwnd = CreateDialogParam(appInstance,
MAKEINTRESOURCE(IDD_TOURGUIDE),
parent,
TourGuideProc,
reinterpret_cast<LONG>(this));
(DLGPROC)TourGuideProc,
reinterpret_cast<LONG_PTR>(this));
}

View File

@ -24,10 +24,10 @@ static const float MaxDistanceLimit = 1.0e6f;
static BOOL APIENTRY ViewOptionsProc(HWND hDlg,
UINT message,
UINT wParam,
LONG lParam)
WPARAM wParam,
LPARAM lParam)
{
ViewOptionsDialog* Dlg = reinterpret_cast<ViewOptionsDialog*>(GetWindowLong(hDlg, DWL_USER));
ViewOptionsDialog* Dlg = reinterpret_cast<ViewOptionsDialog*>(GetWindowLongPtr(hDlg, DWLP_USER));
switch (message)
{
@ -36,7 +36,7 @@ static BOOL APIENTRY ViewOptionsProc(HWND hDlg,
ViewOptionsDialog* Dlg = reinterpret_cast<ViewOptionsDialog*>(lParam);
if (Dlg == NULL)
return EndDialog(hDlg, 0);
SetWindowLong(hDlg, DWL_USER, lParam);
SetWindowLongPtr(hDlg, DWLP_USER, lParam);
//Read labelMode, renderFlags and hud detail
Dlg->initialRenderFlags = Dlg->appCore->getRenderer()->getRenderFlags();
@ -280,8 +280,8 @@ ViewOptionsDialog::ViewOptionsDialog(HINSTANCE appInstance,
hwnd = CreateDialogParam(appInstance,
MAKEINTRESOURCE(IDD_VIEWOPTIONS),
parent,
ViewOptionsProc,
reinterpret_cast<LONG>(this));
(DLGPROC)ViewOptionsProc,
reinterpret_cast<LONG_PTR>(this));
}