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

App developed under 9.0, seeing errors in 9.1.2 not present in 9.0!

Developed an application under 9.0 running normally there. Testing in 9.1.2 and seeing OLE errors and object reference errors. Were there changes in 9.1 that will require redevelopment of an App in 9.1.2? I am seeing errors related to Object reference not set to an instance of an object. There must be differences between 9.0 and later versions. Any suggestions as to how to proceed?

Answers

  • As an Example

    Public Function AdjThresh() As SimpleScript
            AdjThresh = New SimpleScript
            Dim doc1 
    With measure.ThresholdTool.Gadgets.Histogram(AdjThresh)
                .CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.Checked
                .Run()
            End With
    Is throwing  "Object reference not set to an instance of an object" error.
  • There are other differences as well. In v9.0 the use of GetSetting as in where dBF is a floating point array

    dPF(0,0)=GetSetting("Hook", "PassFail", "AMin",.34 )
    Functioned normally.
    In 9.1.x you must convert:
    dPF(0,0)=CDbl(GetSetting("Hook", "PassFail", "AMin",.34 ))

  • Rod,

    I am not able to reproduce the error you are reporting, maybe it happens later in the macro? In general there are no major changes in version 9.1.2, but as the script interpreter is being improved to provide better compliance with VB.NET as well as better performance there might be small differences which we do our best to keep to a minimum.

    Pierre
  • This works okay by itself:
    Imports MediaCy.Addins.ThresholdTool.Gadgets
    Imports MediaCy.Commands
    
    Public Module Macros
    
        Public Function Test() As SimpleScript
            Test = New SimpleScript
    
            With Measure.ThresholdTool.Gadgets.Histogram(Test)
                .CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.Unchecked
                .Run()
            End With
    
            With Measure.ThresholdTool.Gadgets.Histogram(Test)
                .CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.Checked
                .Run()
            End With
    
    
        End Function

    But this does not in the larger App and gens the Obj error:
    'Sub Routines Public Function AdjThresh() As SimpleScript AdjThresh = New SimpleScript Dim doc1 With measure.ThresholdTool.Gadgets.Histogram(AdjThresh) .CheckState = MediaCy.IQL.Application.McCommand.mcCheckState.Checked .Run() End With
    End Function
    This will be messy to debug, something has changed it seems.
    
  • It looks like you have a name conflict, maybe there's a variable called measure or something similar? It's also possible that your imports of namespaces are different in the app and cause  measure.ThresholdTool.Gadgets.Histogram to malfunction.
  • What I do not understand is, I did not touch my code other than to add the string conversion calls. Nothing related to Imports have changed. Why would I now be seeing problems in 9.1.2 that were not visible in 9.0?
  • Rod,

    We use a third party library for our macro interpreter, which we test and validate with our own apps and macros. I don't remember seeing major differences between 9.0 and 9.1.2 but there may be occasional changes, often resulting from actual fixes which may introduce slight behavior changes. If you'd like us to help with any issue resulting from the conversion, please feel free to send your project to our tech support engineers who will be able to clarify things.

    Pierre 
  • Who would you suggest?
  • Rod,

    I'll contact you by email to sort out the incompatility.

    Pierre
Sign In or Register to comment.