Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
How to call c# from c++ - meetup app osaka@10
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Akiko Kawai
February 21, 2026
Programming
0
28
How to call c# from c++ - meetup app osaka@10
2026/2/21 meetup app osaka@10
「C++からC#を呼ぶ方法の一覧」遥佐保
Akiko Kawai
February 21, 2026
Tweet
Share
More Decks by Akiko Kawai
See All by Akiko Kawai
VCpp Link and Library - C++ breaktime 2025 Summer
harukasao
0
290
Coding Experience Cpp vs Csharp - meetup app osaka@9
harukasao
0
1.2k
Selected MAUI Blazor - meetup app osaka@8
harukasao
0
160
Try C++ module! - meetup app osaka@5
harukasao
0
490
シミュレーター制作の感想/ Tried developing Simulator at .NET Lab 201910
harukasao
0
110
NimTorchの紹介 / Introduce NimTorch meetup app osaka @3
harukasao
0
890
std::optionalの使い方 / how to use optional nakamecpp_13
harukasao
0
2.6k
2017/11/12 Optimized C++!
harukasao
0
230
2016/8/9 YEBIS for Unity (beta)のご紹介/Iwate Game Factory 2016 Summer Event
harukasao
0
11k
Other Decks in Programming
See All in Programming
Kubernetesでセルフホストが簡単なNewSQLを求めて / Seeking a NewSQL Database That's Simple to Self-Host on Kubernetes
nnaka2992
0
170
Ruby and LLM Ecosystem 2nd
koic
1
1.2k
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
150
ベクトル検索のフィルタを用いた機械学習モデルとの統合 / python-meetup-fukuoka-06-vector-attr
monochromegane
2
490
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
1k
Takumiから考えるSecurity_Maturity_Model.pdf
gessy0129
1
150
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
190
へんな働き方
yusukebe
5
2.7k
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
300
AI駆動開発の本音 〜Claude Code並列開発で見えたエンジニアの新しい役割〜
hisuzuya
4
530
GoのDB アクセスにおける 「型安全」と「柔軟性」の両立 - Bob という選択肢
tak848
0
250
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
600
Featured
See All Featured
Designing for humans not robots
tammielis
254
26k
Into the Great Unknown - MozCon
thekraken
40
2.3k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Designing for Performance
lara
611
70k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
150
Rails Girls Zürich Keynote
gr2m
96
14k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
jQuery: Nuts, Bolts and Bling
dougneiner
65
8.4k
How to make the Groovebox
asonas
2
2k
Everyday Curiosity
cassininazir
0
170
Large-scale JavaScript Application Architecture
addyosmani
515
110k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
67
37k
Transcript
None
None
None
Type C# → C++(序章) C++ → C#(本丸) COM系 COM Interop(RCW)
COM Interop(CCW) CLI系 C++/CRIラッパー /clr, C++/CLIブリッジDLL Export系 P/Invoke (DLLImport,LibraryImport) DllExport, NativeAOT+[UnmanagedCallersOnly] Hosting系 なし (C++は既にNativeなので Runtime不要) CLR Hosting, hostfxr+[UnmanagedCallersOnly]
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 CRLに組み込まれている DllImport 実行時 LibraryImportビルド時
None
え?なんで? さっきの逆でしょ? C#のメモリ先に飛ん でけばいいやん? 色んなパターンがあり複雑
None
Type C++ → C#(本丸) COM系 COM Interop(CCW) CLI系 /clr 化
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) NativeAOT (.NET
7+) +[UnmanagedCallersOnly] 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 hostfxr (.NET Core
3.0+) +[UnmanagedCallersOnly] 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++/CRIラッパー /clr, C++/CLIブリッジDLL Export系 P/Invoke (DLLImport,LibraryImport) DllExport, NativeAOT+[UnmanagedCallersOnly] Hosting系 なし (C++は既にNativeなので Runtime不要) CLR Hosting, hostfxr+[UnmanagedCallersOnly]
ありがとうございました