Jump to content

FileOpenDialog problem


Recommended Posts

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

$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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

ConsoleWrite(@OSServicePack&@CRLF)

ConsoleWrite(@OSTYPE&@CRLF)

ConsoleWrite(@OSVersion&@CRLF)

ConsoleWrite(@AutoItVersion&@CRLF)

_________________________________

Service Pack 2

WIN32_NT

WIN_XP

3.2.12.1

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...