! ! SUBR comdlger ! subroutine comdlger(iRet) !**************************************************************************************** !* !* THIS SUBROUTINE IS CALLED TO DETECT ERRORS WHEN THE COMMON DIALOGS ARE CREATED !* !**************************************************************************************** use dflib use dfwin implicit none character(30) msg1 character(210) msg2 integer(4) iRet iRet = COMMDLGEXTENDEDERROR() msg1 = 'Cannot Open This Dialog'C select case(iRet) case (CDERR_FINDRESFAILURE) msg2 = 'The common dialog box procedure failed to find a specified resource.'C case (CDERR_INITIALIZATION) msg2 = 'The common dialog box procedure failed during initialization. & This error often occurs when insufficient memory is available.'C case (CDERR_LOCKRESFAILURE) msg2 = 'The common dialog box procedure failed to lock a specified resource.'C case (CDERR_LOADRESFAILURE) msg2 = 'The common dialog box procedure failed to load a specified resource.'C case (CDERR_LOADSTRFAILURE) msg2 = 'The common dialog box procedure failed to load a specified string.'C case (CDERR_MEMALLOCFAILURE) msg2 = 'The common dialog box procedure was unable to allocate memory for internal & &structures.'C case (CDERR_MEMLOCKFAILURE) msg2 = 'The common dialog box procedure was unable to lock the memory associated & &with a handle.'C case (CDERR_NOHINSTANCE) msg2 = 'The ENABLETEMPLATE flag was specified in the Flags member of a structure & for the corresponding common dialog box, but the application failed & &to provide a corresponding instance handle.'C case (CDERR_NOHOOK) msg2 = 'The ENABLEHOOK flag was specified in the Flags member of a structure & &for the corresponding common dialog box, but the application & &failed to provide a pointer to a corresponding hook function'C case (CDERR_NOTEMPLATE) msg2 = 'The ENABLETEMPLATE flag was specified in the Flags member of a structure & &for the corresponding common dialog box, but the application failed & &to provide a corresponding template.'C case (CDERR_STRUCTSIZE) msg2 = 'The lStructSize member of a structure for the corresponding common dialog & &box is invalid.'C case (FNERR_BUFFERTOOSMALL) msg2 = 'The buffer for a filename is too small. (This buffer is pointed to by the & &lpstrFile member of the structure for a common dialog box.)'C case (FNERR_INVALIDFILENAME) msg2 = 'A filename is invalid.'C case (FNERR_SUBCLASSFAILURE) msg2 = 'An attempt to subclass a list box failed because insufficient memory was & &available.'C case default msg2 = 'Unknown error number'C end select if(iRet /= 0)then iRet = MessageBox (Null,msg2,msg1,MB$ICONEXCLAMATION .OR. MB_OK) end if return end subroutine COMDLGER