IPRO Changes

This section lists the new or changed properties, methods, and events of IPRO along with any further additions.

In version 20 of Capture SDK, two new wrapper dll files are provided for easier wrapping of CSDK specific dll files:

  • Nuance.OmniPageSDK.IproPlus.dll
  • Nuance.OmniPageSDK.Toolboxes.dll

These two dll files wrap the IprolPlus.dll: MediumWeightVisuals.dll and the Visuals.dll with functionality similar to those of IproPlus.NET.dll, MediumWeightVisuals.NET.dll, MediumWeightVisualsLib.dll, Visuals.NET.dll and the VisualsLib.dll but with a considerably simpler file set.

The aim is to provide a solution that allows improved usage when Microsoft tools are used for generating wrappers (tlbimp, aximp).

The following new namespaces are created:

  • Nuance.OmniPageSDK.IproPlus.dll : Nuance.OmniPage.CSDK.IproPlus
  • Nuance.OmniPageSDK.Toolboxes.dll : Nuance.OmniPage.CSDK.Toolboxes

The two new dll files are only compatible with each other, they cannot be used with the old wrappers. The server version of the IproPlus outproc is currently not supported.

Important changes compared to the old wrappers

Nuance.OmniPageSDK.IproPlus.dll

  1. There are no interfaces, only classes. For instance, there is only an Engine class instead of EngineClass, Engine interface and the IEngine interface.
  2. Parameter types have been fine-tuned where possible; thus, you can return IPROCHARACTER[] type-specific array instead of the general Array type
  3. IproPlus dispinterface based event interfaces are not supported
  4. IproPlus non-default IUnknown based event interfaces are supported; thus all hard-to-reach events are made public and can be reached immediately on the objects
  5. Event names received an "On" prefix due to the occurring name collisions
  6. Inheritance has changed and the Marshal.ReleaseComObject cannot be called on IproPlus class instances
  7. Each Ipro class implements the IDisposable interface; see usage below for usage information
  8. Each property returning an Ipro object has been split to a void Get and Set function (if it had a setter method) and IproPlus object is passed as out parameter
  9. Each indexer returning an IproPlus object has been split to a void GetItem and SetItem function (if it had a setter method) and IproPlus object is passed as out parameter
  10. Each function returning an IproPlus object has been transformed into a void function and IproPlus object is passed as out parameter

Nuance.OmniPageSDK.Toolboxes.dll

  1. There are no interfaces, only classes. For instance, there is only a ThumbnailView class instead of the ThumbnailViewClass, ThumbnailView interface, IThumbnailView interface, and the AxThumbnailView class describing the thumbnail view
  2. Parameter types have been fine-tuned where possible, similar to the Nuance.OmniPageSDK.IproPlus.dll
  3. Class names arriving from the Visuals.dll have changed, conforming to the MediumWeightVisuals naming conventions; for instance, Ivc became ImageView
  4. Visuals and MediumWeightVisuals dispinterface based event interfaces are not supported
  5. Visuals and MediumWeightVisuals non-default IUnknown based event interfaces are supported; thus, all hard-to-reach events are made public and can be reached immediately on the objects
  6. Visuals and MediumWeightVisuals non-default IUnknown based interfaces are supported; thus all hard-to-reach properties and functions are made public and can be reached immediately on the objects
  7. Event names received an "On" prefix due to the occurring name collisions
  8. IproPlus related objects (usually interfaces) have already been received in events so far; now these can be cast on the appropriate Nuance.OmniPageSDK.IproPlus objects

Programming rules of thumb

The most cumbersome issue with Ipro programming has been releasing native resources, a task complicated by the garbage collector of .NET. The only suggestion was calling the garbage collector after completing a larger work phase in the following way:

  1. GC.Collect();

  2. GC.WaitForPendingFinalizers();

  3. GC.Collect();

  4. GC.WaitForPendingFinalizers();

Though this method is effective, it is definitely cumbersome. With Nuance.OmniPage.CSDK.IproPlus, you can perform deterministic native resource releasing, meaning that each Nuance.OmniPage.CSDK.IproPlus class supports the IDisposable interface and the Dispose method must be called in each case when:

  1. the class instance is created with a 'new' command
  2. the class instance is returned by a function either as a return value or an out parameter
  3. the class instance is returned by a property
  4. the class instance arrives as an event parameter either from Nuance.OmniPageSDK.IproPlus or Nuance.OmniPageSDK.Toolboxes

Disposing is not necessary if the application places the received object in the above four cases in a member variable but be aware that the member variable must be disposed as soon as it becomes useless.

Though the termination of passing IproPlus objects as a return value is a significant change, each passed object can only be forced into a variable this way, also preventing program lines such as:

object1.func1(param1).property1[param2]

in similar cases it is not possible to call dispose on func1 and property1 return values and it results in a leak.

To identify the leak via debugging, the leaked IproPlus object and its type is displayed along with a short stack trace in the debugger output window during the process, based on which the place of object allocation can be revealed.

Development and deployment

The IproPlus.dll, MediumWeightVisuals.dll and the Visuals.dll must be registered (regsvr32) on the developer machine. Though not mandatory, this is by far the simplest solution.

Registration can be avoided on end-user machines if the SxSAllVisuals.manifest and the SxSIproPlus.manifest files can be found in the CSDK binary folder and either of the following criteria is met:

  1. Nuance.OmniPageSDK.IproPlus.dll and the Nuance.OmniPageSDK.Toolboxes.dll are also located in this folder or
  2. Nuance.OmniPageSDK.IproPlus.dll and the Nuance.OmniPageSDK.Toolboxes.dll are elsewhere, but the application sets the path member of Nuance.OmniPage.CSDK.Toolboxes.AssemblyDirectory to point to the CSDK binary folder.

For new customers

Nuance.OmniPageSDK.IproPlus.dll is recommended instead of IproPlus.NET.dll due to a more robust structure and deterministic architecture.