Announcement

Collapse
No announcement yet.

Animate does not function after OpenFileDialog!?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Richard Angell
    replied
    Try this on XP SP2 or SP3, then see if you believe MS that the %OFN_NOCHANGEDIR flag has no effect in XP

    Code:
    #COMPILE EXE
    #DIM ALL
    FUNCTION PBMAIN () AS LONG
        LOCAL PFN$,olddir$
        olddir$ = CURDIR$
        ? "Change to a different directory and select any file,each time."
        DISPLAY OPENFILE 0, , , "",CURDIR$ , "", _
                        "*.*", "", %OFN_ENABLESIZING OR _
                        %OFN_FILEMUSTEXIST OR %OFN_PATHMUSTEXIST OR _
                        %OFN_EXPLORER TO PFN$
                        
        ? "WAS directory: "+ olddir$ + $CRLF + _
          "IS  directory:  "+ CURDIR$ + $CRLF + $CRLF + "file selected:  "+ PFN$,, "omit %OFN_NOCHANGEDIR"
        
        CHDIR olddir$  'back to square one
    
        DISPLAY OPENFILE 0, , , "",CURDIR$ , "", _
                        "*.*", "", %OFN_ENABLESIZING OR _
                        %OFN_FILEMUSTEXIST OR %OFN_PATHMUSTEXIST OR _
                        %OFN_EXPLORER OR %OFN_NOCHANGEDIR TO PFN$
    
        ? "WAS directory: "+ olddir$ + $CRLF + _
          "IS  directory:  "+ CURDIR$ + $CRLF + $CRLF + "file selected:  "+ PFN$,,"with %OFN_NOCHANGEDIR results"
    END FUNCTION
    on this XP system it does!

    Leave a comment:


  • Bruce Brown
    replied
    Check this link
    http://msdn.microsoft.com/en-us/library/ms646839.aspx

    Leave a comment:


  • Rodney Hicks
    replied
    Where is that???
    What?
    If you mean %OFN_NOCHANGEDIR it is in the help file under 'flags' in the DISPLAY OPENFILE page.

    Leave a comment:


  • Cliff Nichols
    replied
    Bruce,
    Where is that??? I am curious if its when user hits "Search", and then in another window goes to check something else???

    Or if it holds the last known folder? (and maybe better than some other techniques)

    Leave a comment:


  • Bruce Brown
    replied
    From MSDN Library:

    OFN_NOCHANGEDIR
    Restores the current directory to its original value if the user changed the directory while searching for files.

    Windows NT 4.0/2000/XP: This flag is ineffective for GetOpenFileName.

    Leave a comment:


  • Alexander Holzer
    replied
    Thanks Steve!
    Now everything is clear.

    Leave a comment:


  • Steve Rossell
    replied
    The OpenFileDialog API call is changing the current directory when selecting a file. Therefore the
    Code:
    Animate_Open hAnimate, "FILECOPY.AVI"
    cannot locate the file "FILECOPY.AVI". You can use the style bit of %OFN_NOCHANGEDIR and the API will keep the current directory the same or use the full path to the AVI filename.

    Leave a comment:


  • Richard Angell
    replied
    Which OS version are you using?

    Leave a comment:


  • Alexander Holzer
    replied
    Originally posted by Richard Angell View Post
    In your program, code unseen here yet, it appears he openfile call should still come after the animate control has been loaded and a file provided to it ...

    What version of PBWin are you using?
    PBWin 9.0
    The mistake or disputed situation with OpenFileDialog and Animate_Open/_Play exist. Also it is the fact.

    Leave a comment:


  • Richard Angell
    replied
    In your program, code unseen here yet, it appears the openfile call should still come after the animate control has been loaded and a file provided to it ...

    What version of PBWin are you using?
    Last edited by Richard Angell; 8 Oct 2008, 08:33 AM.

    Leave a comment:


  • Alexander Holzer
    replied
    Thank you Richard.
    In the example - yes ,but in the correct program it will implement with difficulty.

    Leave a comment:


  • Richard Angell
    replied
    Ms

    Apparently there is a memory or Z-order conflict if you try to run the open file dialog before the animate control is operational. You should send this to [email protected].

    If you place the open file code into the callback in the %WM_INITDIALOG case after this line:

    Animate_Open hAnimate, "FILECOPY.AVI"

    Then it will work.

    Leave a comment:


  • Animate does not function after OpenFileDialog!?

    Hello,
    I stated that Animate_Open/_Play without function after OpenFileDialog call.

    Try PBwin-example "Animate.bas" edit:

    Code:
    ...
    [COLOR="Red"]#INCLUDE "ComDlg32.inc"[/COLOR]
    ...
    
    FUNCTION PBMAIN () AS LONG
    
        LOCAL hDlg AS DWORD
    
    [COLOR="Red"]local f as string
    local lstyle as long
    
    f = "*.txt"
    lstyle = %ofn_filemustexist or %ofn_hidereadonly or %ofn_longnames
    openfiledialog(0, "open file", f, "c:\", _
    "text files|*.txt|all files|*.*", "txt", lstyle)[/COLOR]
    
        InitComCtl32(%ICC_ANIMATE_CLASS)
    
        DIALOG NEW 0, "Animation demo",,, 185, 60, %WS_CAPTION OR %WS_SYSMENU, _
    ...
    and open you any for TXT file. Now try to start animation.
    Idea?

    Thanks.
    Last edited by Alexander Holzer; 7 Oct 2008, 07:34 AM.
Working...
X