I am going to need to ask in the dll forums as to why it's crashing when the Cancel button is being pressed. I've even tried to set the hWnd of the fileselector to DBP's window hWnd handle.
Attached is what I have so far which works as long as the Cancel button isn't pressed. I will get this fixed for you as soon as possible.
The commands in the DLL so far:
int = W32 FSEL() - Returns true if file selected
String = W32 GETCURRENTDIRECTORY() - Returns current working directory
W32 SETCURRENTDIRECTORY dir$ - Sets current working directory
String = W32 GETRELATIVEFILENAME(currdir$,absfile$) - Returns string with a relative path
int result = W32 MESSAGEBOX(message$,title$,type) - Opens a win32 message box dialog
W32 FILEFILTERS filter$ - Sets the fileselector filters (default is "All\0*.*\0Text\0*.TXT\0")
W32 FILEFLAGS flags - Sets fileselectors flags (see below)
file$ = W32 GETPATH() - Returns the absolute file string from fileselector
Notes for the functions in the dll so far:
NOTES for the MessageBox function:
MB_ABORTRETRYIGNORE 0x00000002L
MB_CANCELTRYCONTINUE 0x00000006L
MB_HELP 0x00004000L
MB_OK 0x00000000L
MB_OKCANCEL 0x00000001L
MB_RETRYCANCEL 0x00000005L
MB_YESNO 0x00000004L
MB_YESNOCANCEL 0x00000003L
MB_ICONEXCLAMATION 0x00000030L
MB_ICONWARNING 0x00000030L
MB_ICONINFORMATION 0x00000040L
MB_ICONASTERISK 0x00000040L
MB_ICONQUESTION 0x00000020L
MB_ICONSTOP 0x00000010L
MB_ICONERROR 0x00000010L
MB_ICONHAND 0x00000010L
Return code/value Description
IDABORT 3 The Abort button was selected.
IDCANCEL 2 The Cancel button was selected.
IDCONTINUE 11 The Continue button was selected.
IDIGNORE 5 The Ignore button was selected.
IDNO 7 The No button was selected.
IDOK 1 The OK button was selected.
IDRETRY 4 The Retry button was selected.
IDTRYAGAIN 10 The Try Again button was selected.
IDYES 6 The Yes button was selected
FILE SELECTOR NOTES:
OFN_ENABLESIZING 0x00800000
Enables the Explorer-style dialog box to be resized using either the
mouse or the keyboard. By default, the Explorer-style Open and Save As
dialog boxes allow the dialog box to be resized regardless of whether
this flag is set. This flag is necessary only if you provide a hook
procedure or custom template. The old-style dialog box does not permit
resizing.
OFN_FILEMUSTEXIST 0x00001000
The user can type only names of existing files in the File Name entry
field. If this flag is specified and the user enters an invalid name,
the dialog box procedure displays a warning in a message box. If this
flag is specified, the OFN_PATHMUSTEXIST flag is also used. This flag
can be used in an Open dialog box. It cannot be used with a Save As
dialog box.
OFN_NOCHANGEDIR 0x00000008
Restores the current directory to its original value if the user
changed the directory while searching for files.
This flag is ineffective for GetOpenFileName.
OFN_NONETWORKBUTTON 0x00020000
Hides and disables the Network button.
OFN_PATHMUSTEXIST 0x00000800
The user can type only valid paths and file names. If this flag is used
and the user types an invalid path and file name in the File Name entry
field, the dialog box function displays a warning in a message box.
OFN_READONLY 0x00000001
Causes the Read Only check box to be selected initially when the dialog
box is created. This flag indicates the state of the Read Only check box
when the dialog box is closed.
For more information on the fileselector flags and setting see:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646839(v=vs.85).aspx
I hope for the time being this will help. I'm more than determined to fix the crashing as soon as...
EDIT: Ooops... File is now attached...
Mental arithmetic? Me? (That's for computers) I can't subtract a fart from a plate of beans!
Warning! May contain Nuts!