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):

  • П‑1DoModal() объявлялся как 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 Последовательность для каждого вьювера

  1. File → Open → Project/Solution…, открыть решение вьювера.
  2. Конфигурация Release, платформа x64.
  3. Проверить линковку: Properties → Linker → Input → Additional Dependencies → должны быть sfile95.lib, complex.lib, exprint.lib.
  4. Build → Build Solution (или Rebuild Solution).
  5. Дождаться Build: succeeded.
  6. Убедиться, что .exe в dist\win64\bin.
Linker → Input → Additional Dependencies для вьювера
Linker → Input → Additional Dependencies для вьювера

Скриншот общий с инструкцией win32 — список библиотек тот же (sfile95, complex, exprint). Открывайте свойства при выбранной платформе x64, конфигурация Release.


4.2 TMCROS.exe — вьювер временных сигналов

  • Папка: src\viewers\Tmcrtoutdist\win64\bin\TMCROS.exe
  • Правки П‑1, П‑2 применены (файлы — в 08-porting-changes.md).

4.3 TMCGROUT.exe — вьювер матриц рассеяния

  • Папка: src\viewers\Tmcgroutdist\win64\bin\TMCGROUT.exe
  • Правки П‑1, П‑2 применены.

4.4 TMC_DN.exe — вьювер диаграмм направленностей

  • Папка: src\viewers\DiaNapGrdist\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-1DoModal() was declared as int; in 64-bit MFC the base CDialog::DoModal() returns INT_PTR -> error C2555. The return type was changed to INT_PTR.
  • P-2 — the timer handler OnTimer(UINT) in 64-bit MFC must be OnTimer(UINT_PTR) -> errors C2440/C2737 in the ON_WM_TIMER message 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

  1. File -> Open -> Project/Solution…, open the viewer's solution.
  2. Configuration Release, platform x64.
  3. Check the linking: Properties -> Linker -> Input -> Additional Dependencies -> it must be sfile95.lib, complex.lib, exprint.lib.
  4. Build -> Build Solution (or Rebuild Solution).
  5. Wait for Build: succeeded.
  6. Make sure the .exe is in dist\win64\bin.
Linker -> Input -> Additional Dependencies for a viewer
Linker -&gt; Input -&gt; Additional Dependencies for a viewer

The screenshot is shared with the win32 guide — the library list is the same (sfile95, complex, exprint). Open the properties with the x64 platform selected, Release configuration.


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/cIzl from src\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.