please Test my File Requester

BlitzMax Forums/BlitzMax Programming/please Test my File Requester

Jesse(Posted 2008) [#1]
Sence the File Requester doesn't work on full screen, I decided to make one myself. So far, I have it working to my satisfaction. There are still a few things to add to it but I am pretty much satified with it.
all I have is windows so I don't know if it works on any other OS.
I just would like some feedback to decide whethr to go in to the process of converting it in to a module. let me know if anybody finds a bug. Thanks in advance.
get the file from here:
http://hosted.filefront.com/ChuyP/


Volker(Posted 2008) [#2]
I could just test it in windows xp.
No bugs found.
Changing directorys with mouseclick instead
of "open" is a must.


Jesse(Posted 2008) [#3]
I am working on mouse double click and filters. I will post an update as soon as I have it implemented.
Right now my main concer is with low end graphics cards sence I am copying the front buffer to the back buffer as a single image. I have a feeling some cards are not going to respond as I hope. I posted a new update, same link, none of the mentined changes yet but it is a bit more solid.

Thanks for testing Volker.
I didn't think anybody cared.


Jesse(Posted 2008) [#4]
.


Volker(Posted 2008) [#5]
I get an black screen sometimes when changing
directory; only the requester is viewable.
Changing back to root (c:\) make the background
reappear.
Nvidia 8600 GTS here.


ziggy(Posted 2008) [#6]
I get a crash at start up, (unhandled exception written in green text over the black background) when the graphics object is created. I'm running the application from the desktop under vista.


Jesse(Posted 2008) [#7]
ziggy, I am afraid there is nothing I can do under vista. My computer runs windows xp and is the only operating system I have. I guess I am going to have to limit it to XP and below for now.

@Volker: Fixed the blank image part. I have worked out the change directory and selection of files with a double click.

Thaks for testing.
Now to work on filters.


ziggy(Posted 2008) [#8]
Well, I'm sure it is not a Vista issue as it is a software crash. Have you properly checked folders and file permissions before trying to read them?


Jesse(Posted 2008) [#9]
ziggy, I guess I will have to do a bit of research on that subject. it never even crossed my mind. thanks.


Canardian(Posted 2008) [#10]
It's missing the top level. I can only navigate to C:\, but not to "/" which has C:\, D:\, E:\, etc...


Jesse(Posted 2008) [#11]
yes, I just figured out how to do that. I will fix it as soon as I have some time to do it.


Jesse(Posted 2008) [#12]
today I just added drives But I have one problem. the brl function "FileType" is giving me problems. filetype is checking for availability of drives for use before it returns a responce. Everything works fine for all drives except "a:\" sence there is no media in the drive the program locks up and returns a "Drive Not Ready" error.

Is there a way to bypass the error screen? or is there any other way to handle this? I mean instead of using "FileType".

I have uploaded an update. link in first post.

note:
regarding what ziggy mentioned:
I have tryed it with private files, different account types and different types of files and I have not got it to crash it just sends me back to the previos directory. so I guess it still not working in vista and it wont be be until I get vista and work on it.


Volker(Posted 2008) [#13]
Is there a way to bypass the error screen?  

Use try/catch.
It catches rumtime errors.
There is an example in the help.


Jesse(Posted 2008) [#14]
Thanks Volker But there is no way to use it that way. the error is produced by windows api. and has nothing to do with the program itself.

I even tryed to get to the heart of the command.
the core of "FileType" is a c instruction called "stat_" that is linked to windows api.

I tried to get it to use try catch but no luck:
Local mode,size,mtime,ctime
Try	
	If stat_( "a:\",mode,size,mtime,ctime ) Print "Invalid Dir" Else Print "Dir ok"
Catch a$
	Print a$
End Try



Azathoth(Posted 2008) [#15]
Use the GetDiskFreeSpace or GetDiskFreeSpaceEx API (A or W on the end for ASCII or Widechar) and check the error with GetLastError.

Strict

Const ERROR_PATH_NOT_FOUND = 3
Const ERROR_NOT_READY= 21

Extern "Win32"
	Function GetDiskFreeSpaceExW:Int(lpDirectoryName:Short Ptr , lpFreeBytesAvailable:Long Ptr , lpTotalNumberOfBytes:Long Ptr , lpTotalNumberOfFreeBytes:Long Ptr)
	Function GetLastError:Int()
EndExtern

Local dir:String = "A:\", wstr_dir:Short Ptr=dir.ToWString()
Local freeBytes:Long, tnBytes:Long, tnFreeBytes:Long, err:Int
If GetDiskFreeSpaceExW(wstr_dir , Varptr freeBytes , Varptr tnBytes , Varptr tnFreeBytes) = 0
	err = GetLastError() 
	Select err
		Case ERROR_PATH_NOT_FOUND
			Print "~q"+dir+"~q Not found."
		Case	ERROR_NOT_READY
			Print "~q"+dir + "~q Not ready."
	EndSelect
EndIf
MemFree(wstr_dir)



Jesse(Posted 2008) [#16]
Azathoth, thanks.
But it more or less does the same thing as the one I posted. I get the error:
The drive is not ready for use; its door may be open. Please check drive A: and make sure that a disk is insertd and that the drive door is closed.
which is what I am trying to avoid.
The purpose of this whole thing is just to find out if there is a drive "A:" and not whether it has media or not."

what I want to happen is: When "c:\" is typed or clicked the program will determin if it's a directory or a file(this is where the bug is) that is all. I don't want to see a non related error.
Thanks.


Azathoth(Posted 2008) [#17]
I never got that, GetLastError returned ERROR_NOT_READY.
What happens if you use SetErrorMode(1) prior to calling GetDiskFreeSpaceExW?


Jesse(Posted 2008) [#18]
same thing. maybe you are trying it with media in the drive or maybe your a: drive is not a diskette drive.

it bugs me that I am having so much trouble with something that is almost completeley obsolete.

[edit]
I am guessing I will have the same problem with flash drives.


Azathoth(Posted 2008) [#19]
No, my A: drive is a floppy disk drive. Also works with my DVD drive.
Edit: And there is certainly no media in either of them.


Jesse(Posted 2008) [#20]
I also don't get an error on anything else either. maybe my floppy drive doesn't work. I have not used it in ages. I have replaced every component in my computer except my floppy drive.

I just found out the light in my floppy drive is not going on. my laptop doesn't have a floppy drive so I guess I am stuck with assuming the drive is not working.

thanks for all your help.

p.s.
I don't know how helpfull this are but I found two links relating to floppy drives at microsoft.
http://support.microsoft.com/kb/163920
http://support.microsoft.com/kb/115828/EN-US/


Azathoth(Posted 2008) [#21]
Does the same happen with your CDROM?


Jesse(Posted 2008) [#22]
no, just the floppy drive.