I am working on a little program to check drive space but my code just stops (see below). What am I doing wrong (I'm fairly new to VB6).
Thanks in advance!!!
Private Declare Function SHGetDiskFreeSpace Lib "shell32" Alias "SHGetDiskFreeSpaceA" (ByVal pszVolume As String, pqwFreeCaller As Currency, pqwTot As Currency, pqwFree As Currency) As Long
Private Sub Form_Load()
Form1.Caption = "Disk Space Check"
Call spcchk
End Sub
Private Sub spcchk()
SHGetDiskFreeSpace "C:\", FreeCaller, Tot, Free
Label2.Caption = Format$(Free * 10000, "###,###,###,##0")
If Free >= 320000 Then Label2.BackColor = &H80FF80 Else
Label2.BackColor = &HFF&
DoEvents
End Sub
Private Sub mnuExit_Click()
Unload Me
End
End Sub
Private Sub mnuStart_Click()
If mnuStart.Checked = True Then
mnuStart.Checked = False
Form1.Caption = "Disk Space Check Is Stopped"
Else
mnuStart.Checked = True
Form1.Caption = "Disk Space Check Is Running"
End If
-----End Sub-----It stops right here when I toggle through using Step Into and never goes down to the next sub
Private Sub spcchk2()
SHGetDiskFreeSpace "C:\", FreeCaller, Tot, Free
Label2.Caption = Format$(Free * 10000, "###,###,###,##0")
If Free >= 20000 Then Label2.BackColor = &H80FF80 Else
Label2.BackColor = &HFF&
DoEvents
End Sub
Thanks in advance!!!
Private Declare Function SHGetDiskFreeSpace Lib "shell32" Alias "SHGetDiskFreeSpaceA" (ByVal pszVolume As String, pqwFreeCaller As Currency, pqwTot As Currency, pqwFree As Currency) As Long
Private Sub Form_Load()
Form1.Caption = "Disk Space Check"
Call spcchk
End Sub
Private Sub spcchk()
SHGetDiskFreeSpace "C:\", FreeCaller, Tot, Free
Label2.Caption = Format$(Free * 10000, "###,###,###,##0")
If Free >= 320000 Then Label2.BackColor = &H80FF80 Else
Label2.BackColor = &HFF&
DoEvents
End Sub
Private Sub mnuExit_Click()
Unload Me
End
End Sub
Private Sub mnuStart_Click()
If mnuStart.Checked = True Then
mnuStart.Checked = False
Form1.Caption = "Disk Space Check Is Stopped"
Else
mnuStart.Checked = True
Form1.Caption = "Disk Space Check Is Running"
End If
-----End Sub-----It stops right here when I toggle through using Step Into and never goes down to the next sub
Private Sub spcchk2()
SHGetDiskFreeSpace "C:\", FreeCaller, Tot, Free
Label2.Caption = Format$(Free * 10000, "###,###,###,##0")
If Free >= 20000 Then Label2.BackColor = &H80FF80 Else
Label2.BackColor = &HFF&
DoEvents
End Sub