HexaGen.Runtime.COM 1.1.11

Prefix Reserved
dotnet add package HexaGen.Runtime.COM --version 1.1.11
                    
NuGet\Install-Package HexaGen.Runtime.COM -Version 1.1.11
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HexaGen.Runtime.COM" Version="1.1.11" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HexaGen.Runtime.COM" Version="1.1.11" />
                    
Directory.Packages.props
<PackageReference Include="HexaGen.Runtime.COM" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HexaGen.Runtime.COM --version 1.1.11
                    
#r "nuget: HexaGen.Runtime.COM, 1.1.11"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package HexaGen.Runtime.COM@1.1.11
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=HexaGen.Runtime.COM&version=1.1.11
                    
Install as a Cake Addin
#tool nuget:?package=HexaGen.Runtime.COM&version=1.1.11
                    
Install as a Cake Tool

HexaGen

HexaGen is a comprehensive code generation toolkit for C# and C++ projects. It uses HexaGen.CppAst to parse C/C++ headers and automatically generates C# bindings and wrappers. HexaGen simplifies the process of integrating native libraries with C# applications by automating the creation of interop code.

✨ Features

  • C# Bindings for C Libraries: Automatically generate C# bindings from C headers with support for functions, structs, enums, and callbacks
  • C# Bindings for COM Libraries: Create C# bindings for COM interfaces and objects
  • C++ to C Wrappers: Generate C wrappers around C++ libraries to facilitate C interop
  • Flexible Configuration: JSON-based configuration system with inheritance and composition support
  • Advanced Function Generation: Multiple parameter handling strategies including spans, refs, delegates, and default values
  • Type Mapping: Configurable type mappings and conversions
  • Extension Methods: Generate extension methods for improved API ergonomics
  • Constants to Enums: Convert C preprocessor constants to strongly-typed C# enums

📁 Project Structure

  • HexaGen - Main code generation tool and CLI
  • HexaGen.Core - Core functionality and utilities for code generation
  • HexaGen.Cpp2C - C++ to C wrapper generator
  • HexaGen.Runtime - Runtime support library for generated code (multi-target: .NET 9/8/7/6, .NET Standard 2.0/2.1, .NET Framework 4.7.2, Android)
  • HexaGen.Runtime.COM - Runtime support for COM interop (multi-target: .NET 9/8/7/6, .NET Standard 2.0/2.1, .NET Framework 4.7.2)
  • HexaGen.Language - Language parsing and processing utilities
  • HexaGen.Tests - Unit tests
  • HexaGen.PerformanceTests - Performance benchmarks

🔧 Requirements

  • .NET SDK 9.0 (or compatible version)
  • Clang 17.0.4 or later (for parsing C/C++ headers)
  • Visual Studio 2022 or later (recommended for development)

📦 Installation

NuGet Package

Install HexaGen via NuGet Package Manager:

dotnet add package HexaGen

Build from Source

  1. Clone the Repository:

    git clone https://github.com/HexaEngine/HexaGen.git
    cd HexaGen
    
  2. Build the Project:

    dotnet build
    

🚀 Usage

Basic Example

Create a configuration file (e.g., config.json):

{
  "ApiName": "MyLibrary",
  "Namespace": "MyLibrary.Generated",
  "ImportType": "DllImport",
  "GenerateExtensions": true
}

Generate C# bindings programmatically:

using HexaGen;

var config = CsCodeGeneratorConfig.Load("config.json");
var generator = new CsCodeGenerator(config);
generator.Generate("mylibrary.h", "Output");

⚙️ Configuration

HexaGen uses a JSON-based configuration system that supports:

  • BaseConfig: Configuration inheritance from other files
  • Type Mappings: Custom type conversions
  • Function Rules: Advanced parameter transformation rules
  • Constants to Enum: Convert preprocessor defines to enums
  • Import Types: DllImport, LibraryImport, or delegates

Example configuration with inheritance:

{
  "BaseConfig": {
    "Url": "file://config.base.json",
    "IgnoredProperties": ["IgnoredTypes"]
  },
  "ApiName": "MyAPI",
  "Namespace": "MyAPI.Generated",
  "ImportType": "LibraryImport"
}

C++ to C Generation

For generating C wrappers around C++ libraries:

using HexaGen.Cpp2C;

var config = Cpp2CGeneratorConfig.Load("cpp2c-config.json");
var generator = new Cpp2CGenerator(config);
generator.Generate("mylibrary.hpp", "Output");

🤝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes following the project's coding standards
  4. Add appropriate tests
  5. Submit a pull request

📜 License

HexaGen is licensed under the MIT License. See the LICENSE.txt file for details.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (11)

Showing the top 5 NuGet packages that depend on HexaGen.Runtime.COM:

Package Downloads
Hexa.NET.DirectXTex

A .NET wrapper for the DirectXTex library (2.0.5, Sep 2024).

Hexa.NET.DXGI

A .NET wrapper for DXGI.

Hexa.NET.D3DCommon

A .NET wrapper for D3DCommon.

Hexa.NET.D3D11

A .NET wrapper for D3D11.

Hexa.NET.X3DAudio

A .NET Wrapper for X3DAudio (v 1.7), generated with the HexaGen code generator. HexaGen allows users to access native libraries easily and with high performance.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.11 257 12/19/2025
1.1.10 166 11/1/2025
1.1.9 2,446 11/13/2024
1.1.8 531 11/13/2024
1.1.7 544 11/4/2024
1.1.6 814 11/2/2024
1.1.5 201 11/2/2024
1.1.4 821 8/3/2024
1.0.0 969 9/19/2023