KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

OpenFileDialog errors
Goto page Previous  1, 2
 
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion
View previous topic :: View next topic  
Author Message
apronk
KiXforms Regular
KiXforms Regular


Joined: 28 Jun 2006
Posts: 53
Location: The Netherlands

PostPosted: Mon Oct 29, 2007 5:14 pm    Post subject: Reply with quote

pearly wrote:
apronk, I would recommend upgrading KF.NET to the latest version (3.2.14). I am using OpenFileDialog and do not have a problem.


Installed 3.2.14 on a clean PC and ran my script and still exactly the same problem.

_________________
Achieve inner peace through outer violence.
Back to top
View user's profile Send private message Visit poster's website
pearly
KiXforms Aficionado
KiXforms Aficionado


Joined: 27 Jan 2004
Posts: 332

PostPosted: Mon Oct 29, 2007 9:43 pm    Post subject: Reply with quote

Hmmm, I'm not sure what to say.

I ran this:

Code:

$System = CreateObject("Kixforms.System")

$OpenFileDialog1 = $System.OpenFileDialog()
? @ERROR
? @SERROR
? "KiXtart: " + @KIX
? "KF.NET: " + $System.ProductVersion
? ".NET: " + $System.Environment.Version

Sleep 5
Exit 0


and I get the following:

Code:

0
The operation completed successfully.
KiXtart: 4.60
KF.NET: 3.2.14.0
.NET: 2.0.50727.42


Can you run this on your new machine?
Back to top
View user's profile Send private message
apronk
KiXforms Regular
KiXforms Regular


Joined: 28 Jun 2006
Posts: 53
Location: The Netherlands

PostPosted: Tue Oct 30, 2007 9:07 am    Post subject: Reply with quote

Yeha with that code I get the same result as you. Apprantly it gets the error somewhere during the code of my form, when I place the code in the top of the script it runs. When I call $OpenFileDialog.ShowDialog() from one of the custom UDF's below it gets error'd out.
_________________
Achieve inner peace through outer violence.
Back to top
View user's profile Send private message Visit poster's website
benny69
KiXforms Advocate
KiXforms Advocate


Joined: 30 Oct 2003
Posts: 567
Location: Lincoln, Ne

PostPosted: Tue Oct 30, 2007 12:14 pm    Post subject: Reply with quote

I am not sure what you guys are trying to do but here is an example of how to use .OpenFileDialog in KF.Net and it works fine for me.

Code:

Break On
$System = CreateObject("Kixforms.System")
If Not $System
   $nul= MessageBox("KiXforms.Net Not Initiated. This Script Will Now Close.","Error",16)
   Quit()
EndIf

$Form = $System.Form()
$Form.Left = 0
$Form.StartPosition = 0  ;FormStartPosition_Manual
$Form.Size = $System.Size(400,300) ;(Width,Height)
$Form.Text = "OpenFileDialog Example..."
$Form.Top = 0

;region Open File Dialog
$OpenFileDialog = $System.OpenFileDialog
$OpenFileDialog.DefaultExt = ".ini"
$OpenFileDialog.Filter = "ini files (*.ini)|*.ini"
$OpenFileDialog.FilterIndex = 1
$OpenFileDialog.InitialDirectory = "c:\"
$OpenFileDialog.Title = "Open File Dialog..."
;endregion

$BrowseBtn = $System.Button()
$BrowseBtn.Click = "OpenFileDialogBox()"
$BrowseBtn.Left = 290
$BrowseBtn.Text = "Browse"
$BrowseBtn.Top = 110
$nul = $Form.Controls.Add($BrowseBtn)

$TextBox = $System.TextBox()
$TextBox.Left = 10
$TextBox.Top = 110
$TextBox.Width = 270
$nul = $Form.Controls.Add($TextBox)

$Form.Show  ;Displays the Form

While $Form.Visible
   $Nul = Execute($Form.DoEvents())
Loop
Exit 0

Function OpenFileDialogBox()
   
  $ShowDialog = $OpenFileDialog.ShowDialog
   Select
      Case $ShowDialog = $System.DialogResult_Ok
         $OpenFileName = $OpenFileDialog.FileName
      $TextBox.Text = $OpenFileName
      Case $ShowDialog = $System.DialogResult_Cancel
         $OpenFileDialog.FileName = ""
      $TextBox.Text = ""
   EndSelect
 
EndFunction

_________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)


Last edited by benny69 on Tue Oct 30, 2007 5:30 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
pearly
KiXforms Aficionado
KiXforms Aficionado


Joined: 27 Jan 2004
Posts: 332

PostPosted: Tue Oct 30, 2007 4:41 pm    Post subject: Reply with quote

apronk, if you could, please post the entire code so we can see what went wrong.

otherwise, maybe you can find something in benny's code Wink
Back to top
View user's profile Send private message
apronk
KiXforms Regular
KiXforms Regular


Joined: 28 Jun 2006
Posts: 53
Location: The Netherlands

PostPosted: Wed Oct 31, 2007 7:26 am    Post subject: Reply with quote

Found the problem, it resided in my Function.... can't believe it took me this long to find it. However I dimmed variables before I call $OpenFileDialog1.ShowDialog() thats usually not a problem so I didn't even look there but the problem was that there was a trailing comma behind the last variable because I removed one but forgot the comma.

Sorry folks Confused

_________________
Achieve inner peace through outer violence.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group