ExactSpelling 属性は名前の文字列が完全に一致する時のみ利用可能とするかの属性です。ExactSpelling = true とすることで、完全に一致した関数のみとなります。ExactSpelling = false とすると、部分一致した関数を検索します。以下はサンプルです。
public class Win32
{
[DllImport("user32.dll", CharSet=CharSet.Unicode,
ExactSpelling=false)]
public static extern int MessageBox(IntPtr hWnd, String text,
String caption, uint type);
}
上記の場合、MessageBoxA ( ANSI版 )ではない場合、MessageBoxW ( UNICODE版 ) を探しにいくと行った感じになります。