Added a third function for comdlg32.dll errors on Windows.
This commit is contained in:
parent
910f78c7e5
commit
b7fd5f035e
|
@ -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)))
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue