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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Akiko Kawai
May 29, 2026
Programming
640
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
150
How to call c# from c++ - meetup app osaka@10
harukasao
0
65
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
190
Try C++ module! - meetup app osaka@5
harukasao
0
520
シミュレーター制作の感想/ Tried developing Simulator at .NET Lab 201910
harukasao
0
130
NimTorchの紹介 / Introduce NimTorch meetup app osaka @3
harukasao
0
930
std::optionalの使い方 / how to use optional nakamecpp_13
harukasao
0
2.7k
Other Decks in Programming
See All in Programming
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
350
AmebaブログはKMPから卒業します
kmars0605
0
150
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
35
16k
複雑なUIコンポーネントとの ⻑い付き合い⽅:波及するバグからテスト戦略を経て、安全な再設計へ
mixplace
0
410
phperだってパンチカードでコーディングしたい
o0h
PRO
0
320
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
160
Web Framework Benchmark Battle 2026, Any%
a_matsuda
2
1.4k
IBM Bob でAI駆動開発『QC-Playbook』
ichirokano2
0
110
3回つくってわかった、 定期実行ジョブ基盤の本質情報
takai
0
330
Agents on Rails - Rails at Scale 2026
irinanazarova
0
540
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5k
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
The Curse of the Amulet
leimatthew05
3
15k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Believing is Seeing
oripsolob
1
240
Abbi's Birthday
coloredviolet
4
10k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
450
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
The Invisible Side of Design
smashingmag
301
52k
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]