Disable error dialogs when dll loading fails on Windows
The fix would be mostly for Windows XP as this issue has not been reported under other conditions before (here or with vlc.dotnet). #173 (closed)
Add to Core.Initialize() for Windows only.
[DllImport("kernel32.dll")]
static extern ErrorModes SetErrorMode(ErrorModes uMode);
[Flags]
public enum ErrorModes : uint {
SYSTEM_DEFAULT = 0x0,
SEM_FAILCRITICALERRORS = 0x0001,
SEM_NOALIGNMENTFAULTEXCEPT = 0x0004,
SEM_NOGPFAULTERRORBOX = 0x0002,
SEM_NOOPENFILEERRORBOX = 0x8000
}
var oldMode = SetErrorMode(SYSTEM_DEFAULT);
SetErrorMode(oldMode | SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
We should log failures.