win64 · Шаг 4. Фаза 2 — сборка вьюверов (3 программы)
На этом шаге собираются три вьювера под 64 бита: TMCROS.exe, TMCGROUT.exe, TMC_DN.exe. Все — MFC‑приложения (статическая MFC, MultiByte), линкуются с sfile95, complex, exprint.
Перед сборкой: все 6 библиотек Фазы 1 лежат в
dist\win64\lib. Конфигурация Release, платформа x64.Именно во вьюверах при 64‑битной сборке потребовались правки кода ради разрядности (П‑1 и П‑2). Они уже внесены; подробности — в
08-porting-changes.md.
4.0 Что уже сделано в проектах вьюверов
Настройки сборки (.vcxproj/.sln): старые .vcproj заменены на .vcxproj
(toolset v145), подключён build\ExeOutput.props (вывод в dist\<платформа>\bin),
убраны жёсткие пути D:\work, c:\tmc. Добавлены конфигурации x64.
Правка runtime‑бага вьюверов (Баг #5) — уже в коде; нужна и для win32, и для win64
(это не разрядность). Кратко: SetPathName(..., FALSE) в MakeDocFileName,
AfxOleInit() + SetRegistryKey() в InitInstance, #include <afxdisp.h> в
StdAfx.h. Полное описание — в 07-troubleshooting.md.
64‑битные правки кода (только x64 по смыслу, совместимы с win32):
- П‑1 —
DoModal()объявлялся какint, в 64‑битной MFC базовыйCDialog::DoModal()возвращаетINT_PTR→ ошибкаC2555. Тип возврата изменён наINT_PTR. - П‑2 — обработчик таймера
OnTimer(UINT)в 64‑битной MFC должен бытьOnTimer(UINT_PTR)→ ошибкиC2440/C2737в карте сообщенийON_WM_TIMER.
Здесь применены изменения для 64 бит — см.
08-porting-changes.md, пункты П‑1 и П‑2 (там перечислены конкретные файлы каждого вьювера). На win32 эти типы совпадают (INT_PTR≡int,UINT_PTR≡UINT), поведение не меняется.
4.1 Последовательность для каждого вьювера
- File → Open → Project/Solution…, открыть решение вьювера.
- Конфигурация Release, платформа x64.
- Проверить линковку: Properties → Linker → Input → Additional Dependencies →
должны быть
sfile95.lib,complex.lib,exprint.lib. - Build → Build Solution (или Rebuild Solution).
- Дождаться
Build: succeeded. - Убедиться, что
.exeвdist\win64\bin.

Скриншот общий с инструкцией win32 — список библиотек тот же (
sfile95,complex,exprint). Открывайте свойства при выбранной платформеx64, конфигурацияRelease.
4.2 TMCROS.exe — вьювер временных сигналов
- Папка:
src\viewers\Tmcrtout→dist\win64\bin\TMCROS.exe - Правки П‑1, П‑2 применены (файлы — в
08-porting-changes.md).
4.3 TMCGROUT.exe — вьювер матриц рассеяния
- Папка:
src\viewers\Tmcgrout→dist\win64\bin\TMCGROUT.exe - Правки П‑1, П‑2 применены.
4.4 TMC_DN.exe — вьювер диаграмм направленностей
- Папка:
src\viewers\DiaNapGr→dist\win64\bin\TMC_DN.exe - Правки П‑1, П‑2 применены.
- Использует модули
c2DArray/cIzlизsrc\viewers\DiaNapr(общий предкомпилированный заголовок). На разрядность эти модули не повлияли.
4.5 Проверка Фазы 2
В <КОРЕНЬ>\dist\win64\bin должны быть TMCROS.exe, TMCGROUT.exe, TMC_DN.exe.
Запустите каждый — окно должно открыться без ошибки «Encountered an improper argument».
Для проверки открытия файла используйте samples\SAMPLE_R (например, horns.soc).
Переходите к 05-build-kernels.md.
win64 · Step 4. Phase 2 — building the viewers (3 programs)
In this step three viewers are built for 64 bits: TMCROS.exe, TMCGROUT.exe, TMC_DN.exe. All are MFC applications (static MFC, MultiByte), linking against sfile95, complex, exprint.
Before building: all 6 Phase 1 libraries are in
dist\win64\lib. Configuration Release, platform x64.It is precisely in the viewers that the 64-bit build required code changes for bitness (P-1 and P-2). They are already applied; details in
08-porting-changes.md.
4.0 What has already been done in the viewer projects
Build settings (.vcxproj/.sln): the old .vcproj files were replaced with
.vcxproj (toolset v145), build\ExeOutput.props is attached (output to
dist\<platform>\bin), hard paths D:\work, c:\tmc were removed. The x64 configurations
were added.
A fix for a viewer runtime bug (Bug #5) — already in the code; needed for both win32
and win64 (this is not bitness). Briefly: SetPathName(..., FALSE) in
MakeDocFileName, AfxOleInit() + SetRegistryKey() in InitInstance,
#include <afxdisp.h> in StdAfx.h. Full description in 07-troubleshooting.md.
64-bit code changes (only x64 in meaning, compatible with win32):
- P-1 —
DoModal()was declared asint; in 64-bit MFC the baseCDialog::DoModal()returnsINT_PTR-> errorC2555. The return type was changed toINT_PTR. - P-2 — the timer handler
OnTimer(UINT)in 64-bit MFC must beOnTimer(UINT_PTR)-> errorsC2440/C2737in theON_WM_TIMERmessage map.
The 64-bit changes are applied here — see
08-porting-changes.md, items P-1 and P-2 (they list the specific files of each viewer). On win32 these types coincide (INT_PTR≡int,UINT_PTR≡UINT), the behavior does not change.
4.1 The sequence for each viewer
- File -> Open -> Project/Solution…, open the viewer's solution.
- Configuration Release, platform x64.
- Check the linking: Properties -> Linker -> Input -> Additional Dependencies -> it
must be
sfile95.lib,complex.lib,exprint.lib. - Build -> Build Solution (or Rebuild Solution).
- Wait for
Build: succeeded. - Make sure the
.exeis indist\win64\bin.

The screenshot is shared with the win32 guide — the library list is the same (
sfile95,complex,exprint). Open the properties with thex64platform selected,Releaseconfiguration.
4.2 TMCROS.exe — time-signal viewer
- Folder:
src\viewers\Tmcrtout->dist\win64\bin\TMCROS.exe - Changes P-1, P-2 applied (files — in
08-porting-changes.md).
4.3 TMCGROUT.exe — scattering-matrix viewer
- Folder:
src\viewers\Tmcgrout->dist\win64\bin\TMCGROUT.exe - Changes P-1, P-2 applied.
4.4 TMC_DN.exe — radiation-pattern viewer
- Folder:
src\viewers\DiaNapGr->dist\win64\bin\TMC_DN.exe - Changes P-1, P-2 applied.
- Uses the modules
c2DArray/cIzlfromsrc\viewers\DiaNapr(a shared precompiled header). Bitness did not affect these modules.
4.5 Verifying Phase 2
In <ROOT>\dist\win64\bin there must be TMCROS.exe, TMCGROUT.exe, TMC_DN.exe. Run
each one — the window must open without the "Encountered an improper argument" error. To
test opening a file, use samples\SAMPLE_R (for example, horns.soc).
Proceed to 05-build-kernels.md.