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

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

DllImportAttribute.EntryPoint フィールド

呼び出す DLL エントリ ポイントの名前または序数指定します

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

解説解説

エントリ ポイントの名前は、エントリ ポイント含んでいる DLL の名前を表す文字列を通じて指定できます。または、その序数によってエントリ ポイント指定することもできます序数には、#1 のように、# 記号プリフィックス付けます。このフィールド省略した場合共通言語ランタイムは、DllImportAttribute でマークされ.NET メソッドの名前を使用します

詳細については、DLL 内の関数識別トピック参照してくださいEntryPoint フィールド使用例については、「エントリ ポイント指定」を参照してください

使用例使用例

DllImportAttribute 属性使用して Win32 MessageBox 関数インポートする方法次のコード例示します。このコード例では、EntryPoint プロパティ使用してインポートする関数指定した後、名前を MyNewMessageBoxMethod変更してます。

Imports System
Imports System.Runtime.InteropServices

Module Example

    ' Use DllImport to import the Win32 MessageBox function.
    ' Specify the method to import using the EntryPoint field and 
    ' then change the name to MyNewMessageBoxMethod.
    <DllImport("user32.dll", CharSet:=CharSet.Auto,
 EntryPoint:="MessageBox")> _
    Function MyNewMessageBoxMethod(ByVal hwnd
 As IntPtr, ByVal t As
 String, ByVal caption As String, ByVal t2 As UInt32)
 As Integer
    End Function


    Sub Main()
        ' Call the MessageBox function using platform invoke.
        MyNewMessageBoxMethod(New IntPtr(0), "Hello
 World!", "Hello Dialog", 0)
    End Sub

End Module
using System;
using System.Runtime.InteropServices;

class Example
{
    // Use DllImport to import the Win32 MessageBox function.
    // Specify the method to import using the EntryPoint field and 
    // then change the name to MyNewMessageBoxMethod.
    [DllImport("user32.dll", CharSet = CharSet.Auto, EntryPoint = "MessageBox")]
    public static extern int
 MyNewMessageBoxMethod(IntPtr hWnd, String text, String caption, uint type);
    
    static void Main()
    {
        // Call the MessageBox function using platform invoke.
        MyNewMessageBoxMethod(new IntPtr(0), "Hello World!",
 "Hello Dialog", 0);
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
DllImportAttribute クラス
DllImportAttribute メンバ
System.Runtime.InteropServices 名前空間
DllImportAttribute クラス


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

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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS