For faster navigation, this Iframe is preloading the Wikiwand page for C++マネージ拡張.

C++マネージ拡張

この記事は検証可能参考文献や出典が全く示されていないか、不十分です。 出典を追加して記事の信頼性向上にご協力ください。(このテンプレートの使い方)出典検索?"C++マネージ拡張" – ニュース · 書籍 · スカラー · CiNii · J-STAGE · NDL · dlib.jp · ジャパンサーチ · TWL (2024年2月)

C++マネージ拡張 (Managed Extensions for C++, Managed C++) は、C++.NET Frameworkアプリケーションを記述するための、マイクロソフトによるC++の拡張である。これによって、C++でネイティブコードだけでなく共通言語ランタイム (CLR) に向けたアプリケーションを記述できる。この拡張は、2002年にリリースされたVisual Studio .NET (2002) に含まれるVisual C++ .NET (2002) に初めて搭載された。

なお、2005年後半にリリースされたVisual Studio 2005では、より洗練されたC++/CLIという独立した後継言語が登場し、C++マネージ拡張は非推奨となった。さらにVisual Studio 2015では廃止され、C++/CLIへの移行が促されている[1][2]

マネージドC++およびC++/CLIで記述されたアプリケーションは、C#など他の.NET言語同様に共通中間言語 (CIL) と呼ばれる中間言語にコンパイルされる。「マネージ (Managed)」とは、.NET仮想マシンによって管理されながら動作するという意味である。このため、ガベージコレクタなどのCLRの機能を利用することができ、C#VB.NETなどといった.NET言語のコードを呼び出したり呼び出されたりといた相互運用ができる。

しかし、必要に応じて1つのアセンブリ(EXE/DLL)にネイティブコードも混在できる点が.NET言語の中でも特殊である。このような言語はマネージドC++およびC++/CLIのほかにはない。一般の.NET言語はP/InvokeCOMを通してC++コードとやりとりする必要がある。このため、マネージドC++およびC++/CLIはマネージコードとネイティブコードの橋渡しとしてしばしば利用される。すなわち、C/C++あるいはその他の言語で書かれたライブラリを.NET用で利用するラッパーライブラリを作ったり、その逆を作ったりするために用いられるのである。

マネージドC++は以下のコンパイラで使用できる。

Visual C++ .NET 2002および.NET 2003
コンパイラオプション/clr
Visual C++ 2005以降から2013まで
コンパイラオプション/clr:OldSyntax

関連項目

[編集]

脚注

[編集]
{{bottomLinkPreText}} {{bottomLinkText}}
C++マネージ拡張
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?