McApplication.IMcDocuments Collection looses FileName values
Hi,
with my former post about Image Names, I switched from McImage.Names and DisplayNames to IMcDocument.FileName as this is the one value that never changes.
But now I have noticed, that the FileName values "disappear" on certain occasions (not identified), and only the FileName values. DisplayName and Name values do still return the correct Strings. So my question is, does anybody know why and when the FileName value is returned as empty String (even it returned the correct file path with the same image in the same session before) or if this is a bug.
Best regards,
Helga
Just in case this helps, this is my code snippet (VB.Net app with Image-Pro 11.0.4):
with my former post about Image Names, I switched from McImage.Names and DisplayNames to IMcDocument.FileName as this is the one value that never changes.
But now I have noticed, that the FileName values "disappear" on certain occasions (not identified), and only the FileName values. DisplayName and Name values do still return the correct Strings. So my question is, does anybody know why and when the FileName value is returned as empty String (even it returned the correct file path with the same image in the same session before) or if this is a bug.
Best regards,
Helga
Just in case this helps, this is my code snippet (VB.Net app with Image-Pro 11.0.4):
Function IsImageOpen(ByRef application As Interop.IMcApplication, ByVal imageFilePath As String) As Boolean
Dim isOpen As Boolean
For Each doc As IMcDocument In application.documents.values
If doc.FileName = imageFilePath Then
isOpen = True
Exit For
End If
Next
Return isOpen
End Function
Tagged:
0
Best Answer
-
Hi Helga,
I wouldn't recommend using FileName property as, you have already noticed, it can disappear when the image is no longer associated with a file. It can happen when image is duplicated or converted. McImage.Name is more reliable and always unique in the current Image-Pro session.
Yuri
0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions

