Welcome, Guest. Please login or register.
Did you miss your activation email?
October 23, 2018, 08:25:16 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  VB and the development of wizards
| | |-+  Replacement of (Useraccounts.Commondialog) in Win7
Pages: 1   Go Down
Print
Author Topic: Replacement of (Useraccounts.Commondialog) in Win7  (Read 188 times)
0 Members and 1 Guest are viewing this topic.
koep
Active Member

Offline Offline

Posts: 19


View Profile
« on: October 09, 2018, 02:56:33 PM »

Hi Everyone,

Building on this code https://www.machsupport.com/forum/index.php/topic,23770.0.html I came up with the following
to load DRO values from text file when I was forced to move to Win7.

Rgds,
Tapio

 
Sub GcodeSelect
    Dim MyList()
    Begin Dialog GcodeFileDlg 60, 60, 190, 220, "Gcode file selection", .DlgFunc
        ListBox 10, 10, 150, 180, MyList(), .List1, 2
        CancelButton 42, 198, 40, 12
        OKButton 90, 198, 40, 12   
       End Dialog
   
 Dim frame As GcodeFileDlg
 
    ' Show the GcodeFile dialog
    Dialog frame
End Sub
 
Function DlgFunc( controlID As String, action As Integer, suppValue As Integer)
 
 
    Select Case action
    Case 1 ' Initialize
        temp = Dir( "c:\Mach3\Reseptit\*.*" )
        count = 0 
        While temp <> ""
            count = count + 1
            temp = Dir
        Wend
        Dim x() As String
        ReDim x(count)
        x(0) = Dir( "c:\Mach3\Reseptit\*.*" )
        For i = 1 To count
            x(i) = Dir
        Next i
        DlgListBoxArray "List1", x()
       
    Case 2 ' select
    If controlID = "OK" Then
      Dim newPos As Double
        Open "c:\Mach3\Reseptit\" &DlgText("List1") For Input As #2              'Open the file for reading
      UserDROs = 1060
      For r = 1060 To 1098
      Line Input #2, newPos
      DROState = SetUserDRO(UserDROs, newPos)
      UserDROs =(UserDROs + 1)
      Next r
             'Read the first line of the file
      Close #2
   End If

     End Select

End Function
   
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!