Skip to content

Commit 20e230a

Browse files
authored
Fix entrypoint name for MessageBox sample (#46462)
1 parent 2d452cf commit 20e230a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

samples/snippets/standard/interop/pinvoke/messagebox.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ public partial class Program
66
// Import user32.dll (containing the function we need) and define
77
// the method corresponding to the native function.
88
[LibraryImport("user32.dll", StringMarshalling = StringMarshalling.Utf16, SetLastError = true)]
9-
private static partial int MessageBox(IntPtr hWnd, string lpText, string lpCaption, uint uType);
9+
private static partial int MessageBoxW(IntPtr hWnd, string lpText, string lpCaption, uint uType);
1010

1111
public static void Main(string[] args)
1212
{
1313
// Invoke the function as a regular managed method.
14-
MessageBox(IntPtr.Zero, "Command-line message box", "Attention!", 0);
14+
MessageBoxW(IntPtr.Zero, "Command-line message box", "Attention!", 0);
1515
}
1616
}

0 commit comments

Comments
 (0)