Skip to content

Commit

Permalink
Remove far modifier and _MFC_VER
Browse files Browse the repository at this point in the history
  • Loading branch information
sdottaka committed Aug 20, 2023
1 parent 3bb5701 commit 241f961
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ STDMETHODIMP_(ULONG) CCustomTextRenderer::XCustomTextRenderer::Release()
return pThis->ExternalRelease();
}

STDMETHODIMP CCustomTextRenderer::XCustomTextRenderer::QueryInterface(REFIID iid, LPVOID far* ppvObj)
STDMETHODIMP CCustomTextRenderer::XCustomTextRenderer::QueryInterface(REFIID iid, LPVOID* ppvObj)
{
METHOD_PROLOGUE(CCustomTextRenderer, CustomTextRenderer);
return pThis->ExternalQueryInterface(&iid, ppvObj);
Expand Down
2 changes: 1 addition & 1 deletion Src/Common/CMoveConstraint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ CMoveConstraint::Resize(HWND hWnd, UINT nType)
* Enforce any resizing limitations.
*/
void
CMoveConstraint::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
CMoveConstraint::OnGetMinMaxInfo(MINMAXINFO* lpMMI)
{
// views don't get WM_GETMINMAXINFO, but dialogs & frames do
if (m_hwndDlg == nullptr)
Expand Down
2 changes: 1 addition & 1 deletion Src/Common/CMoveConstraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class CMoveConstraint
// handle WM_SIZE
void Resize(HWND hWnd, UINT nType);
// handle WM_GETMINMAXINFO
void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI );
void OnGetMinMaxInfo(MINMAXINFO* lpMMI );
// handle WM_NCHITTEST
bool OnNcHitTest(UINT message, WPARAM wParam, LPARAM lParam, LRESULT * plresult);
// handle WM_NOTIFY/TTN_NEEDTEXT combination
Expand Down
4 changes: 2 additions & 2 deletions Src/Common/scbarcf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@

IMPLEMENT_DYNAMIC(CSizingControlBarCF, baseCSizingControlBarCF);

int CALLBACK EnumFontFamProc(ENUMLOGFONT FAR *lpelf,
NEWTEXTMETRIC FAR *lpntm,
int CALLBACK EnumFontFamProc(ENUMLOGFONT* lpelf,
NEWTEXTMETRIC* lpntm,
int FontType,
LPARAM lParam)
{
Expand Down
2 changes: 1 addition & 1 deletion Src/Common/scbarg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void CSizingControlBarG::NcPaintGripper(CDC* pDC, const CRect& rcClient)
m_biHide.Paint(pDC);
}

NCHITTEST_RESULT CSizingControlBarG::OnNcHitTest(CPoint point)
LRESULT CSizingControlBarG::OnNcHitTest(CPoint point)
{
CRect rcBar;
GetWindowRect(rcBar);
Expand Down
11 changes: 1 addition & 10 deletions Src/Common/scbarg.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,6 @@
/////////////////////////////////////////////////////////////////////////
#pragma once

// MFC 8/VS.NET 2005 has breaking change in OnNcHitTest return value
#ifndef NCHITTEST_RESULT
#if _MFC_VER >= 0x0800
#define NCHITTEST_RESULT LRESULT
#else
#define NCHITTEST_RESULT UINT
#endif
#endif

/////////////////////////////////////////////////////////////////////////
// CSCBButton (button info) helper class

Expand Down Expand Up @@ -101,7 +92,7 @@ class CSizingControlBarG : public baseCSizingControlBarG
// Generated message map functions
protected:
//{{AFX_MSG(CSizingControlBarG)
afx_msg NCHITTEST_RESULT OnNcHitTest(CPoint point);
afx_msg LRESULT OnNcHitTest(CPoint point);
afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point);
//}}AFX_MSG

Expand Down
10 changes: 5 additions & 5 deletions Src/Common/sizecbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ CSize CSizingControlBar::CalcDynamicLayout(int nLength, DWORD dwMode)
return m_szFloat;
}

void CSizingControlBar::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos)
void CSizingControlBar::OnWindowPosChanging(WINDOWPOS* lpwndpos)
{
// force non-client recalc if moved or resized
lpwndpos->flags |= SWP_FRAMECHANGED;
Expand Down Expand Up @@ -405,7 +405,7 @@ void CSizingControlBar::OnCaptureChanged(CWnd *pWnd)
}

void CSizingControlBar::OnNcCalcSize(BOOL bCalcValidRects,
NCCALCSIZE_PARAMS FAR* lpncsp)
NCCALCSIZE_PARAMS* lpncsp)
{
UNUSED_ALWAYS(bCalcValidRects);

Expand Down Expand Up @@ -542,7 +542,7 @@ void CSizingControlBar::OnPaint()
CPaintDC dc(this);
}

NCHITTEST_RESULT CSizingControlBar::OnNcHitTest(CPoint point)
LRESULT CSizingControlBar::OnNcHitTest(CPoint point)
{
CRect rcBar, rcEdge;
GetWindowRect(rcBar);
Expand Down Expand Up @@ -1345,7 +1345,7 @@ void CSCBMiniDockFrameWnd::OnSize(UINT nType, int cx, int cy)
baseCSCBMiniDockFrameWnd::OnSize(nType, cx, cy);
}

void CSCBMiniDockFrameWnd::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
void CSCBMiniDockFrameWnd::OnGetMinMaxInfo(MINMAXINFO* lpMMI)
{
baseCSCBMiniDockFrameWnd::OnGetMinMaxInfo(lpMMI);

Expand All @@ -1363,7 +1363,7 @@ void CSCBMiniDockFrameWnd::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI)
}
}

void CSCBMiniDockFrameWnd::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos)
void CSCBMiniDockFrameWnd::OnWindowPosChanging(WINDOWPOS* lpwndpos)
{
if ((GetStyle() & MFS_4THICKFRAME) != 0)
{
Expand Down
19 changes: 5 additions & 14 deletions Src/Common/sizecbar.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,6 @@
#include <afxpriv.h> // for CDockContext
#include <afxtempl.h> // for CTypedPtrArray

// MFC 8/VS.NET 2005 has breaking change in OnNcHitTest return value
#ifndef NCHITTEST_RESULT
#if _MFC_VER >= 0x0800
#define NCHITTEST_RESULT LRESULT
#else
#define NCHITTEST_RESULT UINT
#endif
#endif

#if defined(_SCB_MINIFRAME_CAPTION) && !defined(_SCB_REPLACE_MINIFRAME)
#error "_SCB_MINIFRAME_CAPTION requires _SCB_REPLACE_MINIFRAME"
#endif
Expand Down Expand Up @@ -162,8 +153,8 @@ class CSizingControlBar : public baseCSizingControlBar
//{{AFX_MSG(CSizingControlBar)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnNcPaint();
afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
afx_msg NCHITTEST_RESULT OnNcHitTest(CPoint point);
afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp);
afx_msg LRESULT OnNcHitTest(CPoint point);
afx_msg void OnCaptureChanged(CWnd *pWnd);
afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
Expand All @@ -172,7 +163,7 @@ class CSizingControlBar : public baseCSizingControlBar
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
afx_msg void OnWindowPosChanging(WINDOWPOS* lpwndpos);
afx_msg void OnPaint();
afx_msg void OnClose();
afx_msg void OnSize(UINT nType, int cx, int cy);
Expand Down Expand Up @@ -226,8 +217,8 @@ class CSCBMiniDockFrameWnd : public baseCSCBMiniDockFrameWnd

//{{AFX_MSG(CSCBMiniDockFrameWnd)
afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
afx_msg void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
afx_msg void OnWindowPosChanging(WINDOWPOS* lpwndpos);
afx_msg void OnSize(UINT nType, int cx, int cy);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
Expand Down
8 changes: 0 additions & 8 deletions Src/MainFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2449,17 +2449,9 @@ void CMainFrame::StartFlashing()
FlashWindowEx(FLASHW_ALL | FLASHW_TIMERNOFG, 3, 0);
}

#if _MFC_VER > 0x0600
void CMainFrame::OnActivateApp(BOOL bActive, DWORD dwThreadID)
#else
void CMainFrame::OnActivateApp(BOOL bActive, HTASK hTask)
#endif
{
#if _MFC_VER > 0x0600
__super::OnActivateApp(bActive, dwThreadID);
#else
__super::OnActivateApp(bActive, hTask);
#endif

if (GetOptionsMgr()->GetInt(OPT_AUTO_RELOAD_MODIFIED_FILES) == AUTO_RELOAD_MODIFIED_FILES_ONWINDOWACTIVATED)
{
Expand Down
4 changes: 0 additions & 4 deletions Src/MainFrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,11 +361,7 @@ class CMainFrame : public CMDIFrameWnd
afx_msg void OnWindowCloseAll();
afx_msg void OnUpdateWindowCloseAll(CCmdUI* pCmdUI);
afx_msg void OnSaveProject();
#if _MFC_VER > 0x0600
afx_msg void OnActivateApp(BOOL bActive, DWORD dwThreadID);
#else
afx_msg void OnActivateApp(BOOL bActive, HTASK hTask);
#endif
afx_msg void OnToolbarSize(UINT id);
afx_msg void OnUpdateToolbarSize(CCmdUI* pCmdUI);
afx_msg BOOL OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult);
Expand Down
2 changes: 0 additions & 2 deletions Src/MergeFrameCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,8 @@ void CMergeFrameCommon::OnGetMinMaxInfo(MINMAXINFO* lpMMI)
__super::OnGetMinMaxInfo(lpMMI);
// [Fix for MFC 8.0 MDI Maximizing Child Window bug on Vista]
// https://groups.google.com/forum/#!topic/microsoft.public.vc.mfc/iajCdW5DzTM
#if _MFC_VER >= 0x0800
lpMMI->ptMaxTrackSize.x = max(lpMMI->ptMaxTrackSize.x, lpMMI->ptMaxSize.x);
lpMMI->ptMaxTrackSize.y = max(lpMMI->ptMaxTrackSize.y, lpMMI->ptMaxSize.y);
#endif
}

void CMergeFrameCommon::OnDestroy()
Expand Down

0 comments on commit 241f961

Please sign in to comment.