[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1361
  • Last Modified:

How to release image/file.tif from the MODI viewer control

I am using the MODI control in VB6 within an Access 2003 Form. I need to clear the MODI viewer to release the image file, which is a .tif file. I have tried the following code to no avail:

   Set myviewer = Nothing
   Set midoc = Nothing

This doesn't seem to work at all. Anybody have an idea on how to release the file from the MODI viewer?
0
wcohee
Asked:
wcohee
  • 4
  • 2
1 Solution
 
GrahamSkanCommented:
Have you tried midoc.Close?
0
 
wcoheeAuthor Commented:
Graham Skan,
    NO. I'll give it a try and let you know. Thanks.
0
 
wcoheeAuthor Commented:
Graham Skan,
   I gave it a try but it didn't work either. Thanks.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
GrahamSkanCommented:
I'm not very clear what you mean by release. Do you mean that the file is being locked, and cannot be used by another process?

I am currently using VB2010 to look at this problem, but I can run up my system with VB6. Meanwhile it might help to understand if you post some of your code, especially the opening code (or design-time settings, if that is what you use)  
0
 
wcoheeAuthor Commented:
Graham Skan,
      Yes, the file is locked and as long as MODI viewer has it I can't do anything with it.

However, I just tried the following code and it worked just fine:

Private Sub ReleaseImage()
Dim myvar As String
Dim strPath As String
  Set imgdoc = New MODI.Document
    imgdoc.Create ""
    Set myviewer = MiDocView0
    myviewer.Document = imgdoc
   Set myviewer = Nothing
   Set midoc = Nothing
End Sub
         I was just grabbing at straws when I decided to try and put "" as the parameter for the imgdoc.Create statement and lo and behold it worked. Thanks for your help. I really appreciate it. Sorry to put you to any trouble.

0
 
wcoheeAuthor Commented:
I stumbled onto the solution by accident.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now