Directlinq
Registered User.
- Local time
- Today, 13:36
- Joined
- Sep 13, 2009
- Messages
- 67
Hi
Im having an issue with the following code which copys all .MPG files from a dvd disc to a folder on the pc, while copying a progress bar shows. What is happening is sometimes not all files from the discs are being copyed to the computer. But using the same disc it alows me to copy them across manually. So the discs do not have data errors. Is there a problem with this code. I put the "On Error Resume Next" so if data errors did occur it could skip the file and go to the next, but i have no data errors???
Is there a way around this or has anybody got any clues for me to help me solve this problem?
Here is the stripped down code im using
Thanks in advance
Im having an issue with the following code which copys all .MPG files from a dvd disc to a folder on the pc, while copying a progress bar shows. What is happening is sometimes not all files from the discs are being copyed to the computer. But using the same disc it alows me to copy them across manually. So the discs do not have data errors. Is there a problem with this code. I put the "On Error Resume Next" so if data errors did occur it could skip the file and go to the next, but i have no data errors???
Is there a way around this or has anybody got any clues for me to help me solve this problem?
Here is the stripped down code im using
Code:
Private Declare Function SHFileOperation Lib "shell32.dll" (lpFileOp As SHFILEOPSTRUCT) As Long
Private Type SHFILEOPSTRUCT
hwnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAnyOperationsAborted As Long
hNameMappings As Long
lpszProgressTitle As String
End Type
Private Const FOF_CREATEPROGRESSDLG = &H0
Private Const FO_COPY = 2
Private Const FoF_SILENT = &H4
Private Sub Command1_Click()
Dim SH As SHFILEOPSTRUCT
On Error Resume Next
With SH
.fFlags = FoF_SILENT 'flag for progressbar
.wFunc = FO_COPY
.pFrom = "D:\*.MPG"
.pTo = "F:\MediaLib\Video"
End With
Call SHFileOperation(SH)
End If
Exit Sub
Thanks in advance