Need Help Drives In Windows.

Questions regarding syntax

Need Help Drives In Windows.

Postby elgunvo » Sat Sep 04, 2010 1:24 pm

Hi All,

I have a problem. I have a program for Windows and Mac and on the Mac drives are mounted in the Directory /Volumes/ but their is no equivalent for Windows. My question is:

How can i generate a combobox with available drives In Windows?

My VB6 Technique dont work
elgunvo
 
Posts: 17
Joined: Wed Aug 18, 2010 9:47 am

Re: Need Help Drives In Windows.

Postby elgunvo » Sat Sep 04, 2010 1:41 pm

Found the code, If anyone needs help with this PM Me
elgunvo
 
Posts: 17
Joined: Wed Aug 18, 2010 9:47 am

Re: Need Help Drives In Windows.

Postby Slowdown » Sat Sep 04, 2010 2:45 pm

You also can post your solution on the forum, in that case users
do have a direct solution if they encounter the same problems ;)
Regards
Slowdown for now i'm back
Slowdown
 
Posts: 347
Joined: Sat May 02, 2009 6:48 pm
Location: Netherlands

Re: Need Help Drives In Windows.

Postby elgunvo » Sat Sep 04, 2010 5:04 pm

Okay :)

Here is how i got a multiplatform solution to showing all drives on the computer

Code: Select all

'Remove all sample listings for combobox

cmbDrives.removeAll

'Append a User Documents Listing (Just for my Program - the code is in another function but to get this type dir.homepath)
 cmbDrives.append ("folder.png", "User Documents")

'Get the drives list as strings from the folowing command
 
Dim Drives As Strings = Dir.Drives()

'Dir.drives lists the drives from the computer and saves them as a string array

' the code below goes through each drive and adds them to the combobox with a picture to make the combobox look nice.

For Each HDD As String in Drives
    cmbDrives.append ("mac_hdd_icon.png", HDD)
Next 



I found this code in the help menu of kbasic (I have obviously modified it a bit for my program) I hope its of help to others.

Also btw, would anyone like to be an Alpha tester for my application... it's called Codie and is a basic HTML editor with Web preview. If you do when i release the alpha tonight., i'll post the link.. It will be released under the GPL when ready.
elgunvo
 
Posts: 17
Joined: Wed Aug 18, 2010 9:47 am

Re: Need Help Drives In Windows.

Postby Slowdown » Sun Sep 05, 2010 7:26 am

Hi elgunvo,

Sorry your solution is not multi platform :?
Only with Windows XP i can see drives but not on the Mac and not under Linux (Ubuntu).
This is quite logical the directory/file structure is different on the platforms.
If you want to check on what platform your application is running look at,
http://www.kbasic.com/doku.php?id=lrbui ... acos_macro
Regards
Slowdown for now i'm back
Slowdown
 
Posts: 347
Joined: Sat May 02, 2009 6:48 pm
Location: Netherlands

Re: Need Help Drives In Windows.

Postby elgunvo » Mon Sep 06, 2010 10:59 am

I thought so too but it seems to work with Linux tooo... Havent tested on mac as have a different system but i can confirm it working on Linux Mint with Kbasic.
elgunvo
 
Posts: 17
Joined: Wed Aug 18, 2010 9:47 am


Return to Coding Questions

cron