Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
C# and C++ Interoperability - cho-dotnetnew
Search
Akiko Kawai
May 29, 2026
Programming
680
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
C# and C++ Interoperability - cho-dotnetnew
2026/5/29 超dotnetnew
「C++とC#の相互運用」遥佐保
Akiko Kawai
May 29, 2026
More Decks by Akiko Kawai
See All by Akiko Kawai
Unity Scripting Backend - C++breaktime 2026 Summer
harukasao
0
190
How to call c# from c++ - meetup app osaka@10
harukasao
0
69
VCpp Link and Library - C++ breaktime 2025 Summer
harukasao
0
340
Coding Experience Cpp vs Csharp - meetup app osaka@9
harukasao
0
1.3k
Selected MAUI Blazor - meetup app osaka@8
harukasao
0
200
Try C++ module! - meetup app osaka@5
harukasao
0
540
シミュレーター制作の感想/ Tried developing Simulator at .NET Lab 201910
harukasao
0
130
NimTorchの紹介 / Introduce NimTorch meetup app osaka @3
harukasao
0
940
std::optionalの使い方 / how to use optional nakamecpp_13
harukasao
0
2.7k
Other Decks in Programming
See All in Programming
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
360
Materialが消えた日 〜真っ白なFlutterキャンバスにRenderObjectで絵を描く〜
umigishiaoi
0
150
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
790
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
600
はじめてのPLATEAU
nokonoko1203
1
600
Event is what happens
moro
2
3.8k
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
2k
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
3
1.7k
私なりのハーネスエンジニアリング ~独自の言語処理系の開発を通して~
seosoft
0
180
GraphQL の onError と Nullability のこれから
quramy
0
210
SODA - FACT BOOK(JP)
sodainc
1
40k
AI-Powered Domain-Driven Design
ziobrando
0
410
Featured
See All Featured
Chasing Engaging Ingredients in Design
codingconduct
0
390
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
310
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
820
Design in an AI World
tapps
1
380
The Invisible Side of Design
smashingmag
301
52k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Build your cross-platform service in a week with App Engine
jlugia
234
19k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.2k
Paper Plane
katiecoart
PRO
5
55k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
23k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
The Cost Of JavaScript in 2023
addyosmani
56
10k
Transcript
None
None
None
None
Type C# → C++(序章) COM系 COM Interop(RCW) CLI系 C++/CLIラッパー Export系
P/Invoke (DLLImport,LibraryImport) https://learn.microsoft.com/ja-jp/dotnet/standard/native-interop/runtime-callable-wrapper RCW C# Client COM Object C++/CLI 自作Wrapper (/clr) C# Client Native Class/DLL C# Client Marshal (auto- generated) Native DLL CLRに組み込まれている DllImport 実行時 LibraryImportビルド時
None
え?なんで? さっきの逆でしょ? C#のメモリ先に飛ん でけばいいやん?
None
Type C++ → C# COM系 COM Interop(CCW) Windows only 超Legacy
マーシャリング コスト大 CLI系 /clr 化 つまり /clr option Windows only Legacy C++/CLIブリッジDLL CCW C# Object COM Client Native Class/DLLのCLR化 (/clr) IJW(It Just Works) Thunk using VTableFixup C++/CLI 自作ブリッジ DLL C# Object Native Class/DLL C# Object
Type C++ → C# Export 系 DllExport (~.NET Framework) Windows
only 超Legacy NativeAOT (.NET 7+) +[UnmanagedCallersOnly] ホットリロード未対応, ランタイムは固定, 手動でC ABIを解決, ライブラリ抱き込み Cross- platform Build後にToolでC# DLLのILを書き換え パッチDLL(純粋なIL) C# Object using VTableFixup Native Class/DLL AOTコンパイラが C#コードをNativeDLLへ Native Class/DLL C# Native
Type C++ → C# Hosting 系 CLR Hosting APIはCOM Interface,
CCWなし Windows only Hostfxr (.NET Core 3.0+) +[UnmanagedCallersOnly] (.NET 5+) 直接C API使う Cross-platform C++ Process CLR Runtime C# Managed Heap Native Class/DLL C++ Process Core CLR Runtime C# Managed Heap Native Class/DLL
まとめ
Type C# → C++ C++ → C# COM系 COM Interop(RCW)
COM Interop(CCW) CLI系 C++/CLIラッパー /clr, C++/CLIブリッジDLL Export系 P/Invoke (DLLImport,LibraryImport) DllExport, NativeAOT+[UnmanagedCallersOnly] Hosting系 なし (C++は既にNativeなので Runtime不要) CLR Hosting, hostfxr+[UnmanagedCallersOnly]