Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Coming in build 312, as yet unreleased
This removes the following constants:
* `win32con.FILE_ATTRIBUTE_ATOMIC_WRITE`
* `win32con.FILE_ATTRIBUTE_XACTION_WRITE`
* Removed considerations for MFC < 9 (VS 2008) (mhammond#2669, [@Avasam][Avasam])
* This removes the unusable `PyCSliderCtrl.VerifyPos` method

Build 311, released 2025/07/14
------------------------------
Expand Down
20 changes: 0 additions & 20 deletions Pythonwin/win32control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1855,25 +1855,6 @@ static PyObject *PyCSliderCtrl_clear_sel(PyObject *self, PyObject *args)
RETURN_NONE;
}

// @pymethod int|PyCSliderCtrl|VerifyPos|Verify the position is between configured min and max
static PyObject *PyCSliderCtrl_verify_pos(PyObject *self, PyObject *args)
{
CHECK_NO_ARGS(args);
CSliderCtrl *pSC = GetSliderCtrl(self);
if (!pSC)
return NULL;
#if _MFC_VER >= 0x0710
// This just vanished in VS7
PyErr_SetString(PyExc_NotImplementedError, "VerifyPos does not appear in this version of MFC");
return NULL;
#else
GUI_BGN_SAVE;
pSC->VerifyPos();
GUI_END_SAVE;
#endif
RETURN_NONE;
}

// @pymethod int|PyCSliderCtrl|ClearTics|Clear the control's tic marks
static PyObject *PyCSliderCtrl_clear_tics(PyObject *self, PyObject *args)
{
Expand Down Expand Up @@ -1919,7 +1900,6 @@ static struct PyMethodDef PyCSliderCtrl_methods[] = {
{"SetTic", PyCSliderCtrl_set_tic, 1}, // @pymeth SetTic|Set a tick at the position
{"SetTicFreq", PyCSliderCtrl_set_tic_freq, 1}, // @pymeth SetTicFreq|Set the tic mark frequency
{"ClearSel", PyCSliderCtrl_clear_sel, 1}, // @pymeth ClearSel|Clear any control selection
{"VerifyPos", PyCSliderCtrl_verify_pos, 1}, // @pymeth VerifyPos|Verify the positon between min and max
{"ClearTics", PyCSliderCtrl_clear_tics, 1}, // @pymeth ClearTics|Clear any tic marks from the control
{NULL, NULL}};

Expand Down
10 changes: 2 additions & 8 deletions Pythonwin/win32prop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,15 +440,9 @@ PyObject *ui_propsheet_press_button(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "i", &button))
return NULL;
GUI_BGN_SAVE;
BOOL ok = TRUE;
#if _MFC_VER < 0x0710
ok =
#endif
pPS->PressButton(button);

pPS->PressButton(button);
GUI_END_SAVE;
if (!ok)
RETURN_ERR("PressButton failed");

RETURN_NONE;
}

Expand Down
8 changes: 0 additions & 8 deletions Pythonwin/win32thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,8 @@ void CProtectedWinThread::PumpMessages()
// for tracking the idle time state
BOOL bIdle = TRUE;
LONG lIdleCount = 0;
#if _MFC_VER >= 0x0710
_AFX_THREAD_STATE *pState = AfxGetThreadState();
MSG &msgCur = pState->m_msgCur;
#else
MSG &msgCur = m_msgCur;
#endif /* _MFC_VER_ */

// acquire and dispatch messages until a WM_QUIT message is received.
for (;;) {
Expand All @@ -128,11 +124,7 @@ void CProtectedWinThread::PumpMessages()
// pump message, but quit on WM_QUIT
if (!PumpMessage()) {
#if defined(_DEBUG)
#if _MFC_VER < 0x0710
m_nDisablePumpCount--; // application must NOT die
#else
pState->m_nDisablePumpCount--; // application must NOT die
#endif
#endif
return;
}
Expand Down
22 changes: 4 additions & 18 deletions Pythonwin/win32uiExt.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,23 +410,16 @@ class CPythonWndFramework : public T {

protected:
static AFX_DATA const AFX_MSGMAP messageMap;
static const AFX_MSGMAP *PASCAL _GetBaseMessageMap()
{
#if _MFC_VER >= 0x0700
return T::GetThisMessageMap();
#else
return &T::messageMap;
#endif /* _MFC_VER */
}
static const AFX_MSGMAP *PASCAL _GetBaseMessageMap() { return T::GetThisMessageMap(); }
virtual const AFX_MSGMAP *GetMessageMap() const { return &messageMap; }
};

template <class T>
AFX_DATADEF const AFX_MSGMAP CPythonWndFramework<T>::messageMap = {&CPythonWndFramework<T>::_GetBaseMessageMap,
&CPythonWndFramework<T>::_messageEntries[0]};

// ack - compile error in MFC9 (and not x64), and only for ON_WM_NCHITTEST!
#if _MFC_VER >= 0x0900 && !defined(_WIN64)
// ack - compile error on not x64, and only for ON_WM_NCHITTEST!
#if !defined(_WIN64)
#undef ON_WM_NCHITTEST
// from afxmsg_.h - the UINT was originally LRESULT
#define ON_WM_NCHITTEST() \
Expand Down Expand Up @@ -1073,14 +1066,7 @@ class CPythonPrtDlgFramework : public CPythonDlgFramework<T> {
protected:
static AFX_DATA const AFX_MSGMAP messageMap;

static const AFX_MSGMAP *PASCAL _GetBaseMessageMap()
{
#if _MFC_VER >= 0x0700
return T::GetThisMessageMap();
#else
return &T::messageMap;
#endif
}
static const AFX_MSGMAP *PASCAL _GetBaseMessageMap() { return T::GetThisMessageMap(); }
virtual const AFX_MSGMAP *GetMessageMap() const { return &messageMap; }
};

Expand Down
7 changes: 0 additions & 7 deletions Pythonwin/win32uiole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,11 @@
#include "afxdao.h"
#endif

#if _MFC_VER >= 0x0700
#include "afxocc.h"
// Sorry about this - OLE support needs MFC private header.
// You MUST install MFC with source-code to build this extension.
// (and this source must be in "../src" relative to the MFC
// includes, which it is by default)
#else
#ifndef MFC_OCC_IMPL_H
#error(MFC_OCC_IMPL_H must be set to the location of the MFC source code)
#endif
#include MFC_OCC_IMPL_H
#endif /* _MFC_VER */

extern PyObject *PyCOleClientItem_Create(PyObject *self, PyObject *args);

Expand Down
14 changes: 2 additions & 12 deletions Pythonwin/win32win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -889,14 +889,9 @@ static PyObject *ui_window_dlg_dir_select(PyObject *self, PyObject *args)
// @pyparm int|idListbox||The Id of the listbox.
if (!PyArg_ParseTuple(args, "i:DlgDirSelect", &nIDListBox))
return NULL;
int rc;
TCHAR buf[MAX_PATH];
GUI_BGN_SAVE;
#if _MFC_VER >= 0x0800
rc = pWnd->DlgDirSelect(buf, sizeof(buf) / sizeof(TCHAR), nIDListBox);
#else
rc = pWnd->DlgDirSelect(buf, nIDListBox);
#endif
int rc = pWnd->DlgDirSelect(buf, sizeof(buf) / sizeof(TCHAR), nIDListBox);
// @pyseemfc CWnd|DlgDirSelect
GUI_END_SAVE;
if (!rc)
Expand All @@ -916,15 +911,10 @@ static PyObject *ui_window_dlg_dir_select_combo(PyObject *self, PyObject *args)
// @pyparm int|idListbox||The Id of the combobox.
if (!PyArg_ParseTuple(args, "i:DlgDirSelectComboBox", &nIDListBox))
return NULL;
int rc;
TCHAR buf[MAX_PATH];
GUI_BGN_SAVE;
// @pyseemfc CWnd|DlgDirSelectComboBox
#if _MFC_VER >= 0x0800
rc = pWnd->DlgDirSelectComboBox(buf, sizeof(buf) / sizeof(TCHAR), nIDListBox);
#else
rc = pWnd->DlgDirSelectComboBox(buf, nIDListBox);
#endif
int rc = pWnd->DlgDirSelectComboBox(buf, sizeof(buf) / sizeof(TCHAR), nIDListBox);
GUI_END_SAVE;
if (!rc)
RETURN_ERR("DlgDirSelectComboBox failed");
Expand Down