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
.NETのTuple応用チャレンジ WCFとC++/CLI
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
suusanex
April 17, 2019
Programming
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
.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
46
Other Decks in Programming
See All in Programming
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
180
JIS keyboard support in Omarchy
lef237
0
110
phperだってパンチカードでコーディングしたい
o0h
PRO
0
330
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
150
コードで差別化できない時代の ソフトウェアエンジニアリング / Software Engineering in an Era Where Code Doesn’t Differentiate
kishida
2
180
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
270
Workers Cache を知る
syumai
0
360
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
180
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
190
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
APNsからLive Activityを開始する話
yumnumm
0
170
IBM Bob Dojo #1 仕様駆動開発入門
oniak3ibm
PRO
0
390
Featured
See All Featured
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
330
Code Reviewing Like a Champion
maltzj
529
40k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
570
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
940
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.4k
Designing for Performance
lara
612
70k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
820
Color Theory Basics | Prateek | Gurzu
gurzu
1
490
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Designing Experiences People Love
moore
143
24k
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にもどんどん使っていって良さそう