Question Re: OpenDialogEx for desktop only

Discussion in 'Questions (Windows Mobile)' started by RandomCoder, Jul 9, 2008.

  1. RandomCoder

    RandomCoder Well-Known Member Licensed User

    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
     
  2. specci48

    specci48 Well-Known Member Licensed User

  3. RandomCoder

    RandomCoder Well-Known Member Licensed User

    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
     
  4. agraham

    agraham Expert Licensed User

    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
     
  5. specci48

    specci48 Well-Known Member Licensed User

    :signOops::sign0013:

    specci48
     
  6. RandomCoder

    RandomCoder Well-Known Member Licensed User

    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
     
  7. agraham

    agraham Expert Licensed User

    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:

  8. taximania

    taximania Well-Known Member Licensed User

    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 :confused:
     
  9. agraham

    agraham Expert Licensed User

    It's what I posted here http://www.basic4ppc.com/forum/questions-help-needed/2606-drive-detection.html but it won't help for what you want.

    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.
     
  10. taximania

    taximania Well-Known Member Licensed User

    @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 . . .
     
  11. agraham

    agraham Expert Licensed User

    I'm afraid I only have an HID library for the desktop :(
     
  12. RandomCoder

    RandomCoder Well-Known Member Licensed User

    @Agraham,

    I'ved just downloaded and tried your folderdialogue library but unfortunately it hasn't worked. Is this because my work laptop is still using version 5.8?

    Regards,
    RandomCoder
     
  13. agraham

    agraham Expert Licensed User

    I don't know! Try this standalone exe. It doesn't need the library as the library code is merged.
     
  14. Erel

    Erel Administrator Staff Member Licensed User

    The library works fine here - Windows XP.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice