Visual Studio .NET 2003のバグ?
using System; using System.Runtime.InteropServices; namespace ConsoleApplication1 { class Class1 { [STAThread] static void Main(string[] args) { MessageBox(IntPtr.Zero, "おはよう", "CAPTION", 0); } [DllImport("user32", EntryPoint="MessageBox", CharSet=CharSet.Unicode)] public static extern int MessageBox(IntPtr hWnd, string lpText, string lpCaption, uint uType); } }
上のEntryPoint="..."の部分を、EntryPoint=""と空文字列にして、ビルドすると、Visual Studio .NET 2003が何の警告も出さずにクラッシュする……。まあ、ビルド時の問題だし、きちんとEntryPointを設定すればいいっちゃ良いのだけれども……。Visual Studio 2005では修正されているだろうか? それとも俺の環境だけだろうか?