Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Question Re: OpenDialogEx for desktop only


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-09-2008, 12:32 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 486
Awards Showcase
Beta Tester 
Total Awards: 1
Default Question Re: OpenDialogEx for desktop only

Is it possible to use the open dialogue to select a folder rather than a file?
This would present a much more elegant solution than having to use a tree view to select a folder and it's path.

Regards,
RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #2 (permalink)  
Old 07-09-2008, 04:21 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 649
Default

Hi RandomCoder,

The only way I found is using the FileDialogChanger.
Please see this Thread for details:
Source Code Folders On The Device


specci48
Reply With Quote
  #3 (permalink)  
Old 07-10-2008, 12:28 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 486
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Sorry Specci48 but you've mis-interpreted my question.
I would like to select a folder using the OpenDialogueEx control from the desktop only library.
The folder being selected may not have any files within it but I need to get its path. I can use a treeview and the folderchooser example but thats a little long winded compared to the OpenDialogueEx control.

Regards,
RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #4 (permalink)  
Old 07-10-2008, 02:10 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,755
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

You can sort of do it with the Door library by stopping the Dialog checking if a file exists and pre-setting a filename. odx is an OpenDialogEx and obj1 is a Door Object.

Code:
Sub App_Start
	odx.New1
	obj1.New1(false)
	obj1.FromLibrary("odx","ofd",B4PObject(2))
	obj1.SetProperty("CheckFileExists", false)
	obj1.SetProperty("FileName", "_") ' inconspicuous filename
	odx.Show
	f = odx.File
	For i = StrLength(f) - 1 To 0 Step -1
		If StrIndexOf(f, "\",i) > 0 Then
			Exit
		End If
	Next	
	f = SubString(f,0,i)
	Msgbox(f)
End Sub
Reply With Quote
  #5 (permalink)  
Old 07-10-2008, 04:00 PM
specci48's Avatar
Basic4ppc Expert
 
Join Date: Apr 2007
Location: Germany
Posts: 649
Default

Quote:
Originally Posted by RandomCoder View Post
Sorry Specci48 but you've mis-interpreted my question.


specci48
Reply With Quote
  #6 (permalink)  
Old 07-10-2008, 05:34 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 486
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Thanks to both of you for your input.
Using the door library is my prefered solution as I already use this library to catch when a USB device has been attached. The in-built windows file open dialogue is much nicer, plus more familar, than having to use the folder chooser example which uses the tree view library and would cause my program to become quite lengthy.

Cheers
RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #7 (permalink)  
Old 07-10-2008, 05:54 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,755
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

You could also try this FolderDialog library I've just knocked up which exposes the .NET FolderBrowserDialog control. I will include it, together with a GroupBox for grouping controls, in the next version of ControlsExDesktop.
Attached Files
File Type: zip FolderDialogDemo.zip (3.2 KB, 15 views)
Reply With Quote
  #8 (permalink)  
Old 07-10-2008, 05:56 PM
taximania's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: Derbyshire. UK
Posts: 237
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Quote:
Originally Posted by RandomCoder View Post
Thanks to both of you for your input.
Using the door library is my prefered solution as I already use this library to catch when a USB device has been attached.
Do you have an example of this ?
And is it possible to rec/tran data with an attached device.

I'm trying to get a microcontroller connected via a usb cabel,
but not succeeding
__________________
Endemol
Waste of space

O2 XDA Artemis Touch Flo 4.02 Full Cube Rom WM6.1

http://www.taximania.net
Reply With Quote
  #9 (permalink)  
Old 07-10-2008, 06:21 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,755
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by taximania View Post
Do you have an example of this ?
It's what I posted here Drive Detection but it won't help for what you want.

Quote:
I'm trying to get a microcontroller connected via a usb cabel, but not succeeding
I've got several Velleman K8055 I/O boards talking to a C# app interfaced via a C# HID library that I wrote. I've also written a wrapper for the library to suit B4ppc but I've not yet tested it. The Velleman boards use an Arizona PIC16C745-IP that is programmed to act as an HID (Human Interface Device) device. Many cheap USB peripherals are HID devices as Windows has its own HID driver (for keyboards, mice etc) so it avoids having to write a custom USB driver which can get quite messy. If your USB microcontroller is an HID device then you will need to know the Vendor number and PIDBase number in order to connect to it. You will also need to know whatever protocal it uses to transfer data.
Reply With Quote
  #10 (permalink)  
Old 07-10-2008, 07:25 PM
taximania's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: Derbyshire. UK
Posts: 237
Awards Showcase
Beta Tester 
Total Awards: 1
Default

@agraham

The chip is a microchip pic18F2455.
Microchip supply HID software for the chips. pid etc are all
taken care of, apparently.

All I need are the ppc hid files, and work out how to control the
other pins of the chip from within basic4ppc.

Famous last words . . .
__________________
Endemol
Waste of space

O2 XDA Artemis Touch Flo 4.02 Full Cube Rom WM6.1

http://www.taximania.net
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using rapi from desktop to copy file from device to desktop sunnyboyj Questions & Help Needed 9 02-08-2008 12:40 PM


All times are GMT. The time now is 01:24 PM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0