Difference between two commands - Error "Object does not expose the required interface"
In a procedure I use the following command to load a roi in the feature manager.
With [Select].FeaturesManagerCommands.Load(Nothing)
.FileName = roiFileName
.Append = False
.Run()
End With
It happens that after a while the following error "Object does not expose the required interface" may appear. Not always. On some computers often. I tested versions Image Pro 10.0.2 and 10.0.4.

I tried the same command with a direct reference to the automation and recognized that it worked fine.
With MediaCy.Automation.Select.FeaturesManagerCommands.Load(Nothing) .FileName = roiFileName .Append = False .Run() End With
What is the difference between these two commands?
Thanks in advance
fsup
fsup
0
Answers
-
Hi fsup,
This is the same command for both cases. The second case fully defines namespace + command (MediaCy.Automation.Select.FeaturesManagerCommands.Load) in one line. For the first case, namespace defined in 2 sports: Imports MediaCy.Automation - defines part of namespace and [Select].FeaturesManagerCommands.Load - defines second part of namespace + command.
The error message could be related to other projects or modules where 2 commands with the same name defined in the different namespaces. Try to unload other projects or use fully defined namespace.
Thanks,
Nikita.0 -
Hi Nikita,I changed that in the macro and unloaded other projects, but without success. The error still occurs sometimes.Which other causes could the error still have?Thanks,fsup0
-
Hi fsup,
Could you please package you projects and send it to us to review. You can remove unrelated code from it.
Thanks,
Nikita.0 -
Hi Nikita,I sent you a pm.Thanks,fsup0
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