DllImportAttribute.ExactSpelling フィールドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > DllImportAttribute.ExactSpelling フィールドの意味・解説 

DllImportAttribute.ExactSpelling フィールド

DllImportAttribute.CharSet フィールドで、指定された名前以外のエントリ ポイント名をアンマネージ DLL から共通言語ランタイム検索させるかどうか制御します

名前空間: System.Runtime.InteropServices
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public ExactSpelling As Boolean
Dim instance As DllImportAttribute
Dim value As Boolean

value = instance.ExactSpelling

instance.ExactSpelling = value
public bool ExactSpelling
public:
bool ExactSpelling
public boolean ExactSpelling
public var ExactSpelling : boolean
解説解説

false場合文字 A が追加されたエントリ ポイントの名前が DllImportAttribute.CharSet フィールドCharSet.Ansi設定したときに呼び出され文字 W が追加されたエントリ ポイントの名前が DllImportAttribute.CharSet フィールドCharSet.Unicode設定したときに呼び出されます。通常、このフィールドマネージ コンパイラによって設定されます。

プログラミング言語課す既定値を基に、CharSet フィールドExactSpelling フィールドの関係を次の表に示します既定値オーバーライドできますが、オーバーライドするときは慎重に行ってください

言語

ANSI

Unicode

Auto

Visual Basic

ExactSpelling:=True

ExactSpelling:=True

ExactSpelling:=False

C#

ExactSpelling=false

ExactSpelling=false

ExactSpelling=false

C++

ExactSpelling=false

ExactSpelling=false

ExactSpelling=false

使用例使用例

場合によっては、Visual Basic開発者は、マネージ コードDLL 関数定義する際、Declare ステートメント使用する代わりに、DllImportAttribute を使用しますExactSpelling フィールドの設定は、このような事例1 つです。

Imports System.Runtime.InteropServices
 Public Class Win32   
     <DllImport ("user32.dll", ExactSpelling :=
 False)> _
     Public Shared Function
 MessageBox (ByVal hWnd As Integer,
 _
         ByVal txt As String,
 ByVal caption As String,
 _
         ByVal Typ As Integer)
 As Integer
     End Function
 End Class
using System.Runtime.InteropServices;
 public class Win32 {
     [DllImport("user32.dll", CharSet=CharSet.Unicode, 
                ExactSpelling=true)]
     public static extern int
 MessageBoxW(int hWnd, String text, String 
                                           caption, uint type);
 }
using namespace System::Runtime::InteropServices;
 typedef void* HWND;
 [DllImport("user32", CharSet=CharSet::Ansi, ExactSpelling=true)]
 extern "C" int MessageBoxA(HWND hWnd,
                           String* pText,
                           String* pCaption,
                           unsigned int uType);
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DllImportAttribute クラス
DllImportAttribute メンバ
System.Runtime.InteropServices 名前空間


このページでは「.NET Framework クラス ライブラリ リファレンス」からDllImportAttribute.ExactSpelling フィールドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からDllImportAttribute.ExactSpelling フィールドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からDllImportAttribute.ExactSpelling フィールド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

DllImportAttribute.ExactSpelling フィールドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



DllImportAttribute.ExactSpelling フィールドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS