To explain this fault, I have to post some of my code to make things clearer.
A function I use "FillImages", fills a series of Image controls and text box's.
Img1 thru to 4
Text1 thru to 4
The text is the image name "Left$(arrFileNames(i + intIndex - 1, 1), 8)"
On double clicking the image, using a command line utility "edjpgCom.exe" comments are allowed to be added to the
jpg header information.
If I am on the first set of images, ie 4 of 12, using the utility doesn't cause a problem, but.
If I scroll to the next set of images in the current array, the utility still pulls up the first set of image names ie, 1 to 4 of 12
and adds the comment to the wrong image header.
I can see where the problem is, but can't work out the remedy.
Below is the "FillImages" function & "cmdNext" function & "ImgDblClick" function.
I think the fault lies in fillImages, although the images load correctly, double clicking brings up the first array filenames.
<pre>'Imaging
Private Sub FillImages(intIndex As Integer)
Dim i As Integer
Dim fso As New Scripting.FileSystemObject
Dim fil As Scripting.File
imgDel
If intIndex > intFileCount - intNumberOfImages + 1 Then
intIndex = intFileCount - intNumberOfImages + 1
End If
If intIndex < 1 Then
intIndex = 1
End If
For i = 1 To intNumberOfImages
Me.Controls("img" & i).Picture = LoadPicture(strFolder & _
"" & arrFileNames(i + intIndex - 1, 1))
Me.Controls("Text" & i).Text = Left$(arrFileNames(i + intIndex - 1, 1), 8) & _
" -" & "Added" & _
" " & arrFileNames(i + intIndex - 1, 2)
Next
Me.txtInfo = "Images " & intIndex & " to " & _
(intIndex + intNumberOfImages - 1) & " of " & intFileCount
intCurIndex = intIndex
Me.cmdFirst.Enabled = (intIndex > 1)
Me.cmdPrev.Enabled = (intIndex > 1)
Me.cmdNext.Enabled = (intIndex < intFileCount - intNumberOfImages + 1)
Me.cmdLast.Enabled = (intIndex < intFileCount - intNumberOfImages + 1)
End Sub</pre>
<pre>'Imaging
Private Sub cmdNext_Click()
FillImages intCurIndex + MaxNumberOfImages
Pdf1.Visible = True
End Sub</pre>
<pre>'Imaging
Private Function imgDBLclick(i As Integer)
Dim stAppName As String
If arrFileNames(i, 1) = vbNullString Then
MsgBox "No Image To Comment", vbInformation, "Information"
Exit Function
End If
Me.MousePointer = vbHourglass
stAppName = "L:mmpdfutilitiesedjpgcom.exe" & _
" " & "L:MMPDFImage" & arrFileNames(i, 1)
Call Shell(stAppName, 1)
Me.MousePointer = vbDefault
End Function</pre>



