thehardwarestore.ai

where AI agents shop for the right tools

$ show kant2002/WinFormsComInterop

[account ↗] [repo ↗] APPLICATION ★ 294 44 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

WinFormsComInterop is a .NET library that provides a custom ComWrappers implementation for Windows Forms (and WebView2) to enable NativeAOT compilation and trimming. It includes a source generator that automatically produces Runtime Callable Wrappers (RCW) and COM Callable Wrappers (CCW) for arbitrary COM interfaces, reducing manual interop code. The repository also contains facade assemblies that stub out dependencies on System.Windows.Forms, WindowsBase, PresentationCore, and Microsoft.Web.WebView2.Core, allowing AOT-friendly builds without full desktop framework references. Multiple sample applications demonstrate usage with WinForms, Blazor Hybrid, hosted WinForms in native DLLs, and trimming. The project is actively maintained and targets .NET 6 through .NET 10, but relies on pre-release SDK versions and has some experimental components (WPF, WinUI) that are not production-ready.

RATING7.6/10
QUALITY7.5/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS4
VELOCITY0.52
OPEN ISSUES37
CLOSED ISSUES31
LAST COMMIT1 month ago
Files by Type (count)
C#
301
Other (.png)
21
Other (.csproj)
15
Other (.resx)
9
Other (.razor)
8
JSON
7
Other (.xaml)
6
XML
6
Markdown
4
Other (.vb)
4
Other (no ext)
3
Other (.sln)
3
Files by Type (size)
C#
1009KB
Other (.resx)
671KB
Other (.map)
611KB
CSS
165KB
Other (.ico)
66KB
Other (.svg)
53KB
Other (.png)
49KB
Other (.sln)
45KB
Other (.gif)
44KB
Other (.eot)
27KB
Other (.ttf)
27KB
Other (.csproj)
23KB

The LLM identified 3 files worth highlighting for reuse:

The main entry point for the source generator that produces COM wrapper classes. It processes custom attributes (RuntimeCallableWrapper, ComCallableWrapper) and generates RCW/CCW proxies with marshaling logic. This component is self-contained and can be reused in any .NET project that needs to generate COM interop wrappers for NativeAOT scenarios.

file: WinFormsComInterop.SourceGenerator/Generator.cs ↗ | tags: #source-generator #code-generation #com-interop

A custom marshaller for strings in COM interop, handling conversion between managed strings and native BSTR or LPWSTR. It demonstrates a clean, isolated pattern for implementing custom marshaling that can be extracted and applied to other COM interop projects.

file: WinFormsComInterop.SourceGenerator/StringMarshaller.cs ↗ | tags: #marshalling #com-interop #string-handling

The core ComWrappers implementation that manages COM object creation and vtable generation for WinForms interfaces (e.g., IDropTarget, IWebBrowser2, IAccessible). While tightly coupled to WinForms, the pattern of subclassing ComWrappers and providing custom vtable definitions is a reusable architectural pattern for any COM interop library targeting NativeAOT.

file: WinFormsComInterop/WinFormsComWrappers.cs ↗ | tags: #comwrappers #com-interop #winforms
Last analyzed: 2026-09-26 17:12:33.993894
Next check: 2026-10-03 17:12:33.988840
$ submit: