Home Image-Pro Automation (Macros, Apps, Reports)

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

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.
  • 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,
    fsup
  • Hi fsup,

    Could you please package you projects and send it to us to review. You can remove unrelated code from it.

    Thanks,
    Nikita.
  • Hi Nikita,

    I sent you a pm.

    Thanks,
    fsup
Sign In or Register to comment.