Posted: 14th Jun 2007 5:33
So I want to use the open file browser thing. I load the dll fine but when I call the dll I have problems...

gen_OpenFileDialog(ByVal InitialDir As String, _
ByVal FilterStr As String) As String

how would I call this part of the dll with the call dll function? I want it to start in the C:\ drive and it to load .bmp. I'm not smart enough to figure out how to do it
Posted: 14th Jun 2007 16:43
DBP_NETLIB is a plugin, you dont need to ever use CALL DLL, you just type the commands and they should hilite in the ide (if you used the included keywords file - See the doc for instructions to set up the dll and keywords for use in dbp)

to start in C: and see .bmp files only, pass in "","*.bmp|*.bmp"

the function returns a string which contains the full path and file name to the file the user selects, so you need a string variable to hold the result of the function, something like...

MySelectedFile As String
MySelectedFile = gen_OpenFileDialog("","*.bmp|*.bmp")

the modal dialog will appear and will wait for the user to select a file, or press cancel. If cancel is pressed an empty string ("") is returned.

hope that helps
Posted: 14th Jun 2007 18:09
I'll try it out and thanks


EDIT: I get an error
the error is:

Subscript must be Integer or DWORD when referencing an array...?
Posted: 14th Jun 2007 18:49
I just posted this in your other thread too, but here it is:

The dll DBP_NETLIB.dll file has to be copied into the \Compiler\Plugins-User folder inside the Dark Basic Pro installation folder (usually C:\Program Files\Dark Basic Software\Dark Basic Professional).

The compiler mistakenly thinks the command you're calling is an array, because it can't find the correct dll to use, and is thus giving you an error (because the dll is not installed properly).

-Xol
Posted: 14th Jun 2007 18:50
Thats what I have...
My DBP is installed in C: that's it...

C:\Compiler\plugins\User Folder
Posted: 14th Jun 2007 19:01
Well that error means the compiler can't find the correct dll for the command you are using.

When you open up My Computer (from the desktop or Start menu), double-click on Local Disk (C. Do you now see a folder named 'Dark Basic Professional'? If so, open it (double-click on it)

If not, double-click on the folder 'Program Files', then double-click 'Dark Basic Software', then double-click 'Dark Basic Professional'. This is your DBpro installation folder.


If you've now opened your DBpro installation folder, double-click on 'Compiler' then 'plugins-user'. You should see DBP_NETLIB or DBP_NETLIB.dll inside.

If this file is not inside, copy it there from wherever you downloaded it to (right-click on DBP_NETLIB.dll, wherever it is, the choose copy. Then right-click in the user-plugins folder and choose paste).

If DBP_NETLIB.dll is inside your 'user-plugins' folder, then it should be installed.

-Xol
Posted: 14th Jun 2007 19:05
Yay! Thankyou no error message! Now the only problem is: It doesn't do anything it just executes then closes...
Posted: 14th Jun 2007 19:06
You're welcome . Could you post the exact code you are using?

-Xol
Posted: 14th Jun 2007 19:09
+ Code Snippet
MySelectedFile As String
MySelectedFile = gen_OpenFileDialog("","*.bmp|*.bmp")


that's all I have...

It just opens it and closes it... doesn't open dialog or anything :\
What am I doing wrong?
Posted: 14th Jun 2007 19:28
Hmm... I can't get it either. When I execute that I get a "had an inconvenience and needs to close" windows crash-error message. Cattlerustler might know what's going on.

What I can get to compile is in your other thread, Chewy Bacca:
http://forum.thegamecreators.com/?m=forum_view&t=108096&b=1

-Xol
Posted: 14th Jun 2007 19:31
Hmm... The code snippet you put on my other thread does the exact same thing

It just opens then closes...
Posted: 14th Jun 2007 19:36
Now that should work - I just tested it again right now.

What version of DBpro are you using (Click "Help" then "About" in the regular editor). It should be using 1.066, 6.6, or 6.6b (They all mean the same thing).

What editor are you using? I'm using the main one that comes with DBpro, with the lates update from The Game Creators' website.

-Xol
Posted: 14th Jun 2007 19:39
I'm using version 1.055... bought it like 8 months ago. Should I upgrade it?
Posted: 14th Jun 2007 19:41
Then upgrade :

General Updates:
http://darkbasicpro.thegamecreators.com/?f=upgrades

Latest Update:
http://darkbasicpro.thegamecreators.com/?f=upgrade_6_6

Latest Editor Updates:
http://darkbasicpro.thegamecreators.com/?f=ide

A *lot* has been improved since 1.055 (which came out several years ago)

-Xol
Posted: 14th Jun 2007 19:58
Ok I upgraded. I'll post here with the results I get.

And thanks for all of your help.

Yes everything works perfectly thank you so much!
Posted: 14th Jun 2007 20:46
glad its working now - thanks Xolatron for helping Chewy out
I was gonna mention theres 2 dlls with this plugin, one goes in the dbp plugins dir, and the other in your code exe dir, but I guess its sorted then.
Posted: 14th Jun 2007 21:20
You're both welcome .

Oops... I forgot the one in the EXE directory, thanks.

-Xol