In order for an ATEasy application to use a software component, it must learn about the objects exposed by that component. The process by which one application queries another to learn about its objects, methods, and properties is called binding. Early binding occurs when this querying is accomplished at design time, when the code is written, by a reference to a type library. Late binding occurs when this querying is accomplished by a call to the component at run time. Most components support both early and late binding and are therefore referred to as dual-interface components.
The main advantage of early binding over late binding is improved performance for your application. ATEasy applications that use type libraries get access to specific and complete information about an Automation object at design time. The ATEasy application can use this information to declare object variables as types that are specific to that object. Because early bound applications use specific variable declarations, they have better run time performance than late bound applications.
Another advantage of early binding is that the ATEasy compiler can check the syntax and content of the calls to the methods and properties of the objects. This compile time checking reduces the potential for errors at run time.
To bind to an application's component using early binding, add the appropriate type library to your ATEasy application and refer to the objects, properties, and methods described by the type library as needed. Early binding uses a vtable, a virtual table containing the addresses (pointers) for the methods and properties of each Automation object, to perform syntax checking. For instructions on adding a type library to an application, see Inserting a Type Library.
If your ATEasy application uses late binding, it queries the component at run time rather than design time. No type library is used. Because the late bound application doesn't have access to the type information about Automation objects that is contained in a type library, it declares object variables using the generic Object or Variant type rather than data types that are specific to the Automation object. All method and property parameters and their return values are converted to or from the Variant type. The Object type supports the IDispatch interface, a COM interface that provides a way to use an object's properties and methods without having any type information about the object.
Late bound applications must do more work at run time than early bound applications, and their performance suffers by comparison. Late binding is appropriate when you need to implement automation with applications that do not support early binding, or when the ATEasy application will not know until run time the type of the object.