A modern, fast, native Windows serial port terminal built with MFC and C++17.
** Just a clean, professional COM port tool.**
| Feature | Details |
|---|---|
| Multi-mode display | ASCII, HEX, and Mixed (inline hex for non-printable bytes) |
| Timestamps | Per-line HH:MM:SS.mmm timestamps, toggleable |
| Send bar | Type and send text or raw hex bytes (0D 0A 41) |
| CR/LF control | Independent CR and LF append toggles |
| File send | Stream any binary or text file to the port |
| Port enumeration | Auto-detects all available COM ports via SetupAPI |
| Full baud range | 110 to 921600 baud |
| Flow control | None, Hardware (RTS/CTS), Software (XON/XOFF) |
| Line signals | Toggle DTR/RTS; live CTS/DSR status in status bar |
| Dark UI | Dark terminal with color-coded RX (green) / TX (blue) |
| Log save | Export full session log to .log or .txt |
| Settings persistence | Last port config saved to Windows registry |
- Visual Studio 2022 (Community or higher)
- Desktop development with C++ workload
- MFC component (included in the workload)
git clone https://github.com/YOUR_USERNAME/MFCSerialTerminal.git
cd MFCSerialTerminalOpen MFCSerialTerminal.vcxproj in Visual Studio, select Release | x64, and build (Ctrl+Shift+B).
Or from the command line (with MSBuild in PATH):
msbuild MFCSerialTerminal.vcxproj /p:Configuration=Release /p:Platform=x64 /mThe output EXE will be in x64\Release\.
- Launch
MFCSerialTerminal.exe - Go to Connection → Settings and choose your COM port, baud rate, etc.
- Click Connection → Connect (or press
F5) - Type in the send bar and press Enter or click Send
- Toggle HEX checkbox to send raw hex bytes (e.g.
FF 00 1A 0D)
| Key | Action |
|---|---|
F5 |
Connect |
F6 |
Disconnect |
Ctrl+S |
Save log |
Ctrl+L |
Clear log |
Enter (send bar) |
Send text |
##️ Project Structure
MFCSerialTerminal/
├── src/
│ ├── stdafx.h / stdafx.cpp # Precompiled headers
│ ├── SerialTerminal.h / .cpp # CWinApp entry point
│ ├── MainFrame.h / .cpp # Main window, menu, layout
│ ├── SerialPort.h / .cpp # Win32 serial I/O engine (overlapped I/O)
│ ├── TerminalView.h / .cpp # Owner-draw listbox terminal display
│ └── ConnectDialog.h / .cpp # Port settings dialog
├── .github/workflows/build.yml # CI: MSBuild on Windows
├── MFCSerialTerminal.vcxproj # VS2022 project file
└── README.md
- Serial I/O: Full overlapped (async) I/O using
OVERLAPPEDstructs — never blocks the UI thread - Thread safety: Read thread posts
WM_SERIAL_DATAmessages to the UI thread; no shared state accessed without mutex - Display: Custom owner-draw
CListBoxsubclass renders each line with color, timestamp, and direction tag - Port discovery: Uses Windows
SetupAPI(SetupDiGetClassDevs) for accurate COM port enumeration
Pull requests welcome! Ideas for future features:
- Plugin/scripting system (Lua)
- Modbus RTU protocol decoder
- Multi-tab sessions
- Graph/plotter for numeric serial streams
- Auto-reconnect on disconnect
MIT © cada69