Repository navigation
Make ActiveX GDAL operations robust - #78
Conversation
Route retry-timer updates through helpers so StartRetryTimer results are not discarded (C4834), make GdalDispatchWindow.h include atlbase.h, fix escaped newlines in debug output, and record phase 5 results and a lesson. Co-authored-by: Junie <junie@jetbrains.com>
There was a problem hiding this comment.
🟡 Changes recommended
Reactivation can let stale operation IDs and callbacks affect new work, while unguarded allocations in exception handlers can terminate the COM host instead of reporting failure.
4 open issues
What changed in this PR
This PR hardens GDAL operations in MapWinGIS6’s ActiveX wrapper, focusing on diagnostic conversion, COM error reporting, and operation lifecycle management while keeping GDAL execution in Core.
Changes:
- Adds lossy diagnostic conversion and releases completed operation slots before allocating COM results.
- Adds error information to failing automation calls, restart support after Close, and operation-scoped retry timers.
- Extends conversion, restart, timer, and error-info tests; updates documentation and phase tracking.
Builds and tests were not run during this review.
| File | Description |
|---|---|
tests/MapWinGIS.ActiveX.Tests/GdalOperationDispatcherTests.cpp |
Adds dispatcher restart and retry-timer tests. |
tests/MapWinGIS.ActiveX.Tests/ComConversionTests.cpp |
Tests malformed diagnostic text conversion. |
tests/MapWinGIS.ActiveX.Tests/ActiveXActivationTests.cpp |
Adds COM error-description checks. |
src/MapWinGIS.ActiveX/MapWinGISControl.h |
Declares window-creation and client-site hooks. |
src/MapWinGIS.ActiveX/MapWinGISControl.cpp |
Updates result consumption, error reporting, and reactivation. |
src/MapWinGIS.ActiveX/GdalOperationDispatcher.h |
Declares restart and outstanding-operation queries. |
src/MapWinGIS.ActiveX/GdalOperationDispatcher.cpp |
Adds state replacement and native exception-message conversion. |
src/MapWinGIS.ActiveX/GdalEventSource.h |
Declares reactivation and timer-management helpers. |
src/MapWinGIS.ActiveX/GdalEventSource.cpp |
Connects event delivery, reactivation, and timer lifetime. |
src/MapWinGIS.ActiveX/GdalDispatchWindow.h |
Adds explicit retry-timer controls and a self-contained ATL include. |
src/MapWinGIS.ActiveX/ComConversion.h |
Declares lossy diagnostic conversion helpers. |
src/MapWinGIS.ActiveX/ComConversion.cpp |
Implements diagnostic BSTR and array conversion. |
docs/TESTING.md |
Documents diagnostic conversion coverage. |
docs/ARCHITECTURE.md |
Describes operation lifetimes, reactivation, and retry timers. |
.github/plans/development-review-fix-plan-20261113.md |
Records phase completion and validation notes. |
.ai/memory/lessons/lessons.md |
Documents the ATL header include-order requirement. |
Review effort: Balanced
|
Resolved all four review comments. The fixes add generation-scoped event dispatch to prevent stale callbacks after reactivation, make worker exception diagnostics best-effort so allocation failures cannot escape the noexcept worker, preserve operation IDs across dispatcher restarts (with regression coverage for stale-ID lookup/cancellation), and report CoreInitialized errors using IID_IMapWinGISControl. I replied individually in each review thread. GitHub Actions build workflow has started for the latest PR head; validation is pending. |


Summary
Implements phase 5 of the development review fix plan.
EndGdalOperationCOM boundary and return distinct HRESULTs with usefulIErrorInfo. Add error information to failing ActiveX automation calls.IOleObject::Closeto accept GDAL operations again after reactivation.Validation