Jump to content
Sign in to follow this  
Rizzet

FileOpenDialog problem

Recommended Posts

Rizzet

when i use FileOpenDialog my program partly stop working

i can no longer open new files or create GUI's... is this just my windows who got an error or have i missed something?

Share this post


Link to post
Share on other sites
Andreik

when i use FileOpenDialog my program partly stop working

i can no longer open new files or create GUI's... is this just my windows who got an error or have i missed something?

please post your code


When the words fail... music speaks

Share this post


Link to post
Share on other sites
Achilles

I had this problem once... This might help you (from the helpfile):

@WorkingDir is changed on successful return.

If that's not your problem then you're probably manipulating the returned string wrong or not adding possibilities of an @error...

My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

Share this post


Link to post
Share on other sites
Rizzet

please post your code

My current code is very big, but i post a little example of my problem

$testFile = FileOpenDialog("What file?","23","(*.*)",1,"")
        ConsoleWrite("File Path: "&$testFile&@CRLF)
        FileClose($testFile)
        ConsoleWrite("anyfile.txt Exists: " & FileExists(@ScriptDir&"\anyfile.txt") &@CRLF)
        $testFile2 = FileOpen("anyfile.txt",0)
        ConsoleWrite("anyfile.txt Contains: " & $testFile2 & @CRLF &"Error = "&  @Error & @CRLF)
        FileClose($testFile2)

and my the data posted

File Path: C:\IniBrain.ini
anyfile.txt Exists: 1
anyfile.txt Contains: -1
Error = 0
>Exit code: 0   Time: 2.431

Share this post


Link to post
Share on other sites
PsaltyDS

My current code is very big, but i post a little example of my problem

$testFile = FileOpenDialog("What file?","23","(*.*)",1,"")
        ConsoleWrite("File Path: "&$testFile&@CRLF)
        FileClose($testFile)
        ConsoleWrite("anyfile.txt Exists: " & FileExists(@ScriptDir&"\anyfile.txt") &@CRLF)
        $testFile2 = FileOpen("anyfile.txt",0)
        ConsoleWrite("anyfile.txt Contains: " & $testFile2 & @CRLF &"Error = "&  @Error & @CRLF)
        FileClose($testFile2)

and my the data posted

File Path: C:\IniBrain.ini
anyfile.txt Exists: 1
anyfile.txt Contains: -1
Error = 0
>Exit code: 0   Time: 2.431
$testFile2 = -1 means the FileOpen() failed, most likely because you didn't provide the full path as in FileExists(). Try it with this:
$testFile2 = FileOpen(@ScriptDir & "\anyfile.txt",0)

:P

P.S. Even if FileOpen() works, it returns the handle to the open file, not the data in the file. Your "anyfile.txt Contains:" implies you have that confused.

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
Rizzet

$testFile2 = -1 means the FileOpen() failed, most likely because you didn't provide the full path as in FileExists(). Try it with this:

$testFile2 = FileOpen(@ScriptDir & "\anyfile.txt",0)

:P

P.S. Even if FileOpen() works, it returns the handle to the open file, not the data in the file. Your "anyfile.txt Contains:" implies you have that confused.

its not only that that doesnt work.. the file things was just a fast example.. just took the first file things that open a file in any way

i this is all kind of problems.. All File* or Ini* or GUI* things get messed up, its like i cant return things from windows anymore

Share this post


Link to post
Share on other sites
PsaltyDS

its not only that that doesnt work.. the file things was just a fast example.. just took the first file things that open a file in any way

i this is all kind of problems.. All File* or Ini* or GUI* things get messed up, its like i cant return things from windows anymore

Sigh... :P

So, lets reset and try this again from the top: Please post a short reproducer script that actually runs and actually produces the symptoms.

Without that, there is nothing to talk about.

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
Rizzet

Sigh... :P

So, lets reset and try this again from the top: Please post a short reproducer script that actually runs and actually produces the symptoms.

Without that, there is nothing to talk about.

:P

my script do reproduce the symptoms..for me. have you tried the script?? just make a anyfile.txt in the same folder as the script then open what ever file you want (exept the andfile.txt) with the dialog. If it works for you then its a problem with my computor

Share this post


Link to post
Share on other sites
BrettF
Rizzet

ConsoleWrite(@OSServicePack&@CRLF)

ConsoleWrite(@OSTYPE&@CRLF)

ConsoleWrite(@OSVersion&@CRLF)

ConsoleWrite(@AutoItVersion&@CRLF)

_________________________________

Service Pack 2

WIN32_NT

WIN_XP

3.2.12.1

Share this post


Link to post
Share on other sites
BrettF
Rizzet

i've downloaded the beta and it all seems to work now

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×