LoginSignup
18
18

More than 1 year has passed since last update.

C++/CLI, C++/CX, WRL, C++/WinRT違いメモ

Last updated at Posted at 2018-12-11

メモの目的

URLや共有したい情報を記載。

作成中。

C++ 言語・フレームワーク等比較

言語・フレームワーク・プロジェクション(?) 将来性 特徴 メリット デメリット
WinAPI 昔ながらのAPI。直接使うことはほぼない
MFC オワコン VS2017ではオプション
C++/CLI オワコン VS2017ではオプション グルー言語用途で使える C++混在だとstd::mutexが使えない、自動並列化オプション/Qparが使えない など制限があったりする。
C++/CX オワコン VS2017ではオプション  公式がWinRT仕様を推奨
WRL オワコン VS2017ではオプション  公式がWinRT仕様を推奨
C++/WinRT Microsoft公式推し

C# から呼べるか

C#(.NET)から呼び出す方法

No. 項目 説明 メリット デメリット
1 COM COMで通信
2 DLLImport C#からDLLImport使う。
3 CLI C#からは普通のライブラリとして呼べる。 C++/CLIがオワコン

C++の種類ごとに使える方法

C++種類(フレームワーク・プロジェクション) 可・不可 説明
WinAPI COMかDLLImport
MFC COMで。DLLImportもいける?知らんけど。
C++/CLI CLI
C++/CX 可? COM?
WRL 可? COMがどうとか言うてるので呼べるでしょう。
C++/WinRT 可らしい http://www.moonmile.net/blog/archives/3429 でそんな感じのことが。まだちゃんと読んでない。COMだけどCOMかどうか意識しないでいい?

参考URL

C++/CLI

Microsoft「C++ のサポート ライブラリ」
https://docs.microsoft.com/ja-jp/cpp/dotnet/cpp-support-library?view=vs-2017

C++/CLIとC++混在でstd::mutex使えないのでその代わりを実装

WinRT

For authoring and consuming Windows Runtime APIs using C++, there is C++/WinRT. This is Microsoft's recommended replacement for the C++/CX language projection, and the Windows Runtime C++ Template Library (WRL).

(https://docs.microsoft.com/ja-jp/windows/uwp/cpp-and-winrt-apis/より引用)

Microsoft「C++/WinRT」
https://docs.microsoft.com/ja-jp/windows/uwp/cpp-and-winrt-apis/

Kenny Kerr「C++ - C++/WinRT の紹介」
https://msdn.microsoft.com/ja-jp/magazine/mt745094.aspx

Moonmile Solutions Blog 「[win8] c++/cx から c# のライブラリは使えない…と思ったが使える」
http://www.moonmile.net/blog/archives/3429

18
18
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
18