about
12/06/2022
Interop Repo
Interop code

Interop  Repository

Two languages working together

Quick Status Code functions correctly no known defects Demonstration code yes Documentation yes Test cases none planned Static library none planned Build requires C++17 option, C# 7.0 Planned design changes Add more demo code

1.0 Concept

Interop is a term used to describe collaboration between two or more components written in different languages. In this repository there are examples of interoperation between code written in C++, C++\CLI, and C#.
One reason for using interop is to take advantage of the very well engineered Windows Presentation Foundation (WPF) framework to build Graphical User Interfaces (GUIs) for C++ code. WPF requires the use of a .Net language, usually C#, but occasionally C++\CLI.

2.0 Contents

This repository provides a collection of interoperation useage demos and examples:
  • CppBridge:
    Demonstrates interop by running a native C++ tokenizer from a C# client, using a C++\CLI shim class to connect the client and tokenizer.
  • FormsInterop:
    Expands on the first demo by using three different GUI implementations, a C++\CLI form, a C# winform, and a C# WPF form.
  • ManagedCPP:
    Provides examples of C++\CLI (managed code) and native C++ interacting in code from a single file. A number of projects are included. The best place to start is with the Managed_Again project.
  • ManagedCppSyntaxExamples:
    A collection of small and simple demonstrations of C++\CLI features.
  • WPF-ConsoleApplication:
    Shows how to provide console output from a WPF application.
  • WPF-Interop:
    This is a prototype for the WPF GUIs you will see packaged with many of the tools in the Tools collection.

3.0 Build

This code has been built with Visual Studio, Community Edition - 2019, and tested on Windows 10.
  Next Prev Pages Sections About Keys