DllImportAttribute.EntryPoint フィールド
アセンブリ: 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); } }

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からDllImportAttribute.EntryPoint フィールドを検索する場合は、下記のリンクをクリックしてください。

- DllImportAttribute.EntryPoint フィールドのページへのリンク