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
Akiko Kawai
February 21, 2026
Programming
37
0
Share
How to call c# from c++ - meetup app osaka@10
2026/2/21 meetup app osaka@10
「C++からC#を呼ぶ方法の一覧」遥佐保
Akiko Kawai
February 21, 2026
More Decks by Akiko Kawai
See All by Akiko Kawai
VCpp Link and Library - C++ breaktime 2025 Summer
harukasao
0
310
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
500
シミュレーター制作の感想/ Tried developing Simulator at .NET Lab 201910
harukasao
0
110
NimTorchの紹介 / Introduce NimTorch meetup app osaka @3
harukasao
0
900
std::optionalの使い方 / how to use optional nakamecpp_13
harukasao
0
2.6k
2017/11/12 Optimized C++!
harukasao
0
240
2016/8/9 YEBIS for Unity (beta)のご紹介/Iwate Game Factory 2016 Summer Event
harukasao
0
12k
Other Decks in Programming
See All in Programming
AgentCore Optimizationを始めよう!
licux
3
260
Oxlintはいかにしてtsgolintのlint ruleを呼び出しているのか
syumai
1
290
権限チェックの一貫性を型で守る TypeScript による多層防御
mnch
3
200
ソースコード→AST→オペコード、の旅を覗いてみる
o0h
PRO
1
140
PHPでバイナリをパースして理解するASN.1
muno92
PRO
0
460
柔軟なPDFレイアウトエディタを支える型システム設計 — Discriminated UnionとConditional Typeの実践
minako__ph
2
210
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
3
970
決定論 vs 確率論:Gemini 3 FlashとTF-IDFを組み合わせた「法規判定エンジン」の構築
shukob
0
170
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
520
20260514_its_the_context_window_stupid.pdf
heita
0
1.1k
Migrations : C'est une question d'hygiène !
vinceamstoutz
0
680
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
460
Featured
See All Featured
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
140
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
510
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
How Software Deployment tools have changed in the past 20 years
geshan
0
33k
Claude Code のすすめ
schroneko
67
220k
The Cult of Friendly URLs
andyhume
79
6.9k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
Amusing Abliteration
ianozsvald
1
170
Unsuck your backbone
ammeep
672
58k
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]
ありがとうございました