wincom
A lightweight Rust wrapper for Windows COM IDispatch automation.
wincom focuses on the late-binding path that most scripting hosts
(AutoCAD, CorelDRAW, Office, …) expose. It provides:
ComObject— wraps anIDispatchand offers name-based property reads/writes and method invocation.Variant— a RAII wrapper overVARIANTthat callsVariantClearon drop, eliminating a common source of leaks.- Conversions —
i16/i32/i64,u8/u16/u32/u64,f64,bool,String, andVec<f64>in both directions.
Example
use ;
COM must already be initialized on the calling thread:
use Com;
unsafe ;
// ... use ComObject ...
unsafe ;
Platform
Windows only. On other platforms the crate compiles to an empty library
(#![cfg(windows)]).
Threading
ComObject is not Send or Sync. COM objects are apartment-bound;
marshal them explicitly if you need cross-thread access.
Minimum supported Rust version
Rust 1.71 or later.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.