Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Help with the "comdlg32.dll" - file browser

Author
Message
Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 15th Feb 2005 23:53
I've been trying to figure out how to use the "Comdlg32.dll", but haven't had any luck with it. I need to use the "Openfilename" function, but I can't it to work right. Can someone help me out with it?

Thanks

Kelebrindae
21
Years of Service
User Offline
Joined: 15th Sep 2003
Location: Where cheeses are scarier than dragons.
Posted: 16th Feb 2005 18:31 Edited at: 16th Feb 2005 18:34
If I understand well, you want to display a standard File Identification Dialog (so the user can choose a specific file), then get the chosen file name.

Here's a few functions that'll do the trick:


Copy all this at the end of your code. To call the dialog, insert
"filename$ = getFileName(FileBoxTitle$,FileFilter$)" in your code.
- FileBoxTitle$ is the title of the dialog, with a character "^" at the end.
- FileFilter$ determines what kind of file the user will be able to choose. It looks like this: "Image BMP, GIF, JPG^*.bmp;*.gif;*.jpg^^". The part before the first "^" is what the user will see. The part between this "^" and the "^^" at the end of the string is a list of filters (with ";" as separator).

I hope it helps . Tell me if you have a problem...

Ideas: memories of things which did not occur yet...
Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 16th Feb 2005 23:55 Edited at: 9th Jun 2006 01:55
nevermind.

Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 17th Feb 2005 07:48 Edited at: 17th Feb 2005 07:51
I got one more question, how do I make it save a file?

Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 17th Feb 2005 17:55
Instead of using "GetOpenFileNameA", use "GetSaveFileNameA", with all the same parameters etc, etc.

Jess.


Team EOD :: Programmer/All-Round Nice Guy
Aust. Convention!
Underworld 1020
21
Years of Service
User Offline
Joined: 2nd Mar 2004
Location: NY, USA
Posted: 17th Feb 2005 21:44
Ya, I didn't even really try to understand the code because it is way past my skill level, so I didn't even notice the "GetOpenFileNameA" line in there .

Thanks guys

Login to post a reply

Server time is: 2025-05-25 06:55:59
Your offset time is: 2025-05-25 06:55:59