Frank O's CommonDialog Class & MaxFileSize

Discussion in 'AutoCAD' started by Dave F, Feb 27, 2004.

  1. Dave F

    Dave F Guest

    Hi All

    I'm using Frank's excellent class routine in multi file select mode.
    Initially the line below was 256, which allowed only about half a dozen
    files to be selected in one go.

    I've upped it to 1024 & ran it a couple of times - it works fine, but just
    to be sure, I want to check if there's anything I should be aware of.

    Does it need to be in multiples of 256?

    Private Sub Class_Initialise()
    mvarMaxFileSize = 1024 ' DOES THIS CAUSE A PROBLEM?
    mvarFileName = String(mvarMaxFileSize, 0)
    End Sub

    Another Q:
    The returned files are out of order: when using the shift key the first
    selected is listed last & last selected is first.
    The rest in the middle are in order.
    Is this consistent? If it is I can work around it, or is there a way to
    solve it?

    Cheers
    TIA
    Dave F.
     
    Dave F, Feb 27, 2004
    #1
  2. No. That property sets the size of the internal string buffer used to return
    the selected file names to you. You can set it to whatever you like.
    This behavior stems from the API itself.

    --
    There are 10 kinds of people. Those who understand binary and those who
    don't.

    http://code.acadx.com
    (Pull the pin to reply)
     
    Frank Oquendo, Feb 27, 2004
    #2
  3. Dave F

    Dave F Guest

    Thanks Frank,

    One more Q:
    Is there a way to set it dynamically once I know the length of the returned
    string?

    TIA
    Dave F.
     
    Dave F, Mar 1, 2004
    #3
  4. No. An improperly sized buffer will yield truncated results if not just
    plain 'ol garbage.

    --
    There are 10 kinds of people. Those who understand binary and those who
    don't.

    http://code.acadx.com
    (Pull the pin to reply)
     
    Frank Oquendo, Mar 1, 2004
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.