5 Commits
Author SHA1 Message Date
Claude 93a6e00f70 Suspend, resume and terminate running threads
SuspendThread now stops a running thread where it is: with Mach's
thread_suspend on macOS, and elsewhere with a signal whose handler waits
until the count is back to zero. ResumeThread counts down and lets it
go; a thread can suspend itself and be resumed by another. The count is
kept as on Windows (MAXIMUM_SUSPEND_COUNT, ERROR_SIGNAL_REFUSED).

TerminateThread stops a thread for good: before it starts, while it
runs, or while it is held. As on Windows, nothing it holds is let go
and its stack is not unwound; its handle is signaled with the exit code.

The cooperative threads of DOS and the classic Mac OS can still be held
only before they start.

core tests threads made suspended, held while running (and by
themselves), and terminated at each stage.

Signed-off-by: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
2026-11-27 17:27:39 +00:00
Claude 6b66cc3396 Build the core classes for 16-bit Windows
make TARGET=i8086-pc-win16 builds libmfc.a in the large model with the
core classes: CObject, CString, the collections, CFile, CArchive, CTime,
the exceptions and the memory diagnostics. This is the first step to
MFC 2.5 for 16-bit Windows.

- afx.h sets _AFX_WIN16 and STRICT there and includes afxwin16.h, which
  gives the Win32 types and declares the KERNEL32 functions that the
  core classes call. src/win16.cpp implements them over the C library
  and the 16-bit KERNEL.
- On Win16 the library defines all the global new and delete operators,
  as the OMF linker has no weak definitions.
- Casts of pointers to UINT_PTR become DWORD_PTR, which is as wide as a
  pointer on every target (UINT_PTR is 16 bits on Win16).
- CTimeSpan::GetDays no longer overflows a 16-bit int.
- tests/core.cpp checks CFileFind and CFile::GetStatus, and builds for
  Win16.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRTV4u8c9f3gQUmqvq
2026-11-24 05:23:14 +00:00
Claude 7b0dc25396 Portable layer: link and run the console tests on Linux and macOS
The libraries now link: the interface and class IDs, string resources,
rectangles, system colors and metrics, hooks, Windows Sockets over BSD
sockets, VARIANT conversion and safe arrays, the COM library within one
process (task memory, GUID text, classes the program registers, streams
over global memory) and a registry kept in a text file. The functions
not implemented yet are placeholders generated from port/src/stubs.txt
that fail with ERROR_CALL_NOT_IMPLEMENTED (E_NOTIMPL for HRESULTs).

Dispatch keeps long as the C++ type of VT_I4, as MFC documents it,
converting where long is 64 bits: member properties, by-reference
arguments, and InvokeHelper's VTS_PI4. LARGE_INTEGER and CY are laid out
for big-endian systems too.

make check runs the core and automation tests natively; CI builds and
tests on Linux and macOS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRw4kkFHrrHRhkcuLw
Signed-off-by: Claude <noreply@anthropic.com>
2026-11-07 16:06:07 +00:00
Claude d9a4a1ae3e afxpriv.h, afxadv.h, afxconv.h/atlconv.h, afxres.rc and afxprint.rc
- atlconv.h: CA2W, CW2A and the T/OLE forms with code pages, and the
  USES_CONVERSION macros (A2W, T2A, OLE2T, A2BSTR, ...).
- afxadv.h: CSharedFile, a memory file in global memory.
- afxres.rc and afxprint.rc, generated from the library's built-in
  strings (tools/gen-rc.py), for resource scripts that include them.
- oleaut32 is linked automatically.
- MDI print preview test (in-memory toolbar), and the SDI test now
  includes afxres.rc and afxprint.rc.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRUqfQ3sTcDCMdNCGGs
2026-11-06 16:52:15 +00:00
Claude 2559d6654d Frames, doc/view, common dialogs and controls, control bars, splitter, form and edit views, printing (WIP)
Adds the document/view architecture (CFrameWnd, MDI, CDocument,
templates), the common dialogs and property sheets (afxdlgs.h), the
common controls (afxcmn.h), control bars, splitter windows, form,
edit, list and tree views, printing (afxext.h, afxcview.h), the sync
objects (afxmt.h), a Makefile and a console test of the core classes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRUqfQ3sTcDCMdNCGGs
2026-11-06 15:48:22 +00:00