Added a third function for comdlg32.dll errors on Windows.

This commit is contained in:
Pietro Gagliardi 2014-08-25 16:18:29 -04:00
parent 910f78c7e5
commit b7fd5f035e
2 changed files with 6 additions and 1 deletions

View File

@ -21,6 +21,11 @@ func xpanichresult(msg *C.char, hresult C.HRESULT) {
panic(fmt.Errorf("%s; HRESULT: 0x%X", C.GoString(msg), hresult))
}
//export xpaniccomdlg
func xpaniccomdlg(msg *C.char, err C.DWORD) {
panic(fmt.Errorf("%s; comdlg32.dll extended error: 0x%X", C.GoString(msg), err))
}
//export xmissedmsg
func xmissedmsg(purpose *C.char, f *C.char, uMsg C.UINT) {
panic(fmt.Errorf("%s window procedure message %d does not return a value (bug in %s)", C.GoString(purpose), uMsg, C.GoString(f)))

View File

@ -47,7 +47,7 @@ WCHAR *openFile(void)
err = CommDlgExtendedError();
if (err == 0) // user cancelled
return NULL;
xpanic("error running open file dialog", GetLastError());
xpaniccomdlg("error running open file dialog", err);
}
return filenameBuffer;
}