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
.NETのTuple応用チャレンジ WCFとC++/CLI
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
suusanex
April 17, 2019
Programming
160
0
Share
.NETのTuple応用チャレンジ WCFとC++/CLI
.NETのTuple(ValueTuple)を、WCFで使えるか。そして、C++/CLIからは呼べるのか。これを実験してみました。
suusanex
April 17, 2019
More Decks by suusanex
See All by suusanex
Azure DevTestLabsはデスクトップアプリ開発のテストを楽にしてくれる
suusanex
1
37
Other Decks in Programming
See All in Programming
Mastering Event Sourcing: Your Parents Holidayed in Yugoslavia
super_marek
0
140
20260315 AWSなんもわからん🥲
chiilog
2
180
安いハードウェアでVulkan
fadis
1
880
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
1
240
20260320登壇資料
pharct
0
160
Xdebug と IDE による デバッグ実行の仕組みを見る / Exploring-How-Debugging-Works-with-Xdebug-and-an-IDE
shin1x1
0
330
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
160
Coding at the Speed of Thought: The New Era of Symfony Docker
dunglas
0
4.4k
Coding as Prompting Since 2025
ragingwind
0
670
LM Linkで(非力な!)ノートPCでローカルLLM
seosoft
0
360
「速くなった気がする」をデータで疑う
senleaf24
0
130
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.2k
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.6k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Embracing the Ebb and Flow
colly
88
5k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
160
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Odyssey Design
rkendrick25
PRO
2
560
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
230
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
170
Design in an AI World
tapps
0
190
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.5k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Transcript
.NETのTuple応用チャレンジ WCFとC++/CLI 須藤圭太
自己紹介 • ID:suusanex( connpass・Twitter・GitHub共通) • 名前:須藤圭太 • サイエンスパーク株式会社という独立系ソフトウェアベンダーに所属 • 4年ほど受託開発で、上流から下流まで全部を回す
• ここ6年ほどは、自社製品開発を担当 • 勉強会、今後も開いていきます。次は5/14! • 今回は「Driver Module Framework(DMF)、VS静的解析、RPCデ バッグ等」やります • https://sciencepark.connpass.com/event/126600/ • https://sciencepark.connpass.com/
Tupleとは • 複数の変数をまとめた型を、一時的に作れる • 戻り値の例 • (int retInt, string retString)Func();
• var ret = Func(); • ret.retInt; • 匿名型と違って、変数名がIntellisenseとコンパイルの対象になる • タイポしない!
応用:WCFのSOAP通信にも使えるか? • まだサポートが続いている.NET 4.5.2で実験 • 4.6以前を使う場合、NuGetでライブラリ追加が必要
• 戻り値にTupleを使ってみて、問題なくコンパイルが通った
• SOAP通信に成功、ちゃんとTupleで戻り値が取得できた • XMLの中ではItem1,Item2といった形で並んでいる <FuncResult xmlns:d4p1="http://schemas.datacontract.org/2004/07/System" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <d4p1:Item1>1</d4p1:Item1> <d4p1:Item2>1になった理由</d4p1:Item2> </FuncResult>
C++/CLIから呼べるか? • 定義はC#で、C++/CLIのコンソールアプリから呼び出す • とりあえずは書ける。Tupleの型が扱えないので、NuGetで取得
• NuGetで参照エラー • 直接参照でチャレンジ
• Tupleの変数が見れない • Item1,Item2だった(以前からあるGeneric版?) • 動いてはいるが、デバッグはできない
• .NET 4.7.2の組み込みTupleを使っても、結果は同じ
まとめ • TupleはWCFのSOAP通信にも使える • C++/CLIでも、一応使える(変数名が見れないが) • プロセス間通信のI/Fにもどんどん使っていって良さそう