|
-
Jul 25th, 2003, 10:16 AM
#1
Thread Starter
New Member
picturebox and file permissions
i've been trying to figure this one out for 3 days now... with no luck. lets see if you guys can help me out 
the program i'm working on is kindof an image browser. it grabs some images from a dll, saves them locally, and lets you go through them one (each is refered to as a candidate image) by one comparing them with 'sister' images that exist in 6 remote directories, and allows you to update those directories as required. while you're going through the local drive, you have the option of editing the candidate with several droplets i've created in photoshop. here-in lies my puzzle.
what happens is that the candidate image (mfSubject), which the user is being shown in a picturebox, is copied (mfGuineaPig) to the binary folder. the droplet is then invoked (system.diagnostic.process.start (myDroplet,myGuineaPigPath)), photoshop does it's thing, then i'm trying to save the copied file over the original candidate file and i jump right to my error handler (in the event... isn't in the method below).
i've narrowed it down to one possibility: the picturebox is holding my file 'hostage'... while the program is running, i can't even delete the thing from explorer... and i can't get the image to 'release' it no matter what i've found as possible 'ransom'...
make sense? anyway... here's the method... any ideas?
==========================================
Private Sub callAPI(ByVal eProcess As cmeImgProcess, ByVal strImgPath As String)
Dim objFSO As New Scripting.FileSystemObject()
imgCandidate.Image = Nothing
If objFSO.FileExists(strImgPath) Then
mfSubject = objFSO.GetFile(strImgPath)
objFSO.CopyFile(mfSubject.Path, getAppPath() & "\" & mfSubject.Name, True)
mfGuineaPig = objFSO.GetFile(getAppPath() & "\" & mfSubject.Name)
strImgPath = """" & mfGuineaPig.Path & """"
Select Case eProcess
Case cmeImgProcess.eipRegular
System.Diagnostics.Process.Start("save140x200.exe", strImgPath)
End Select
If objFSO.FileExists(mfGuineaPig.Path) And objFSO.FileExists(mfSubject.Path) Then
'mfSubject = Nothing
' MsgBox(mstrImportPath & "\" & mfGuineaPig.Name & vbCrLf & mfSubject.Path)
objFSO.CopyFile(mfGuineaPig.Path, mstrImportPath & "\" & mfGuineaPig.Name, True)
objFSO.DeleteFile(mfGuineaPig.Path)
setImages() ' refreshes all pictureboxes
Else
MsgBox("File does not exist")
End If
End If
If Not objFSO Is Nothing Then objFSO = Nothing
End Sub ' activate ps Droplet
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|