Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Does the TestStand 2.0.x and Earlier ActiveX Automation Adapter Support the Creation or Manipulation of COM Objects that Implement a Custom Interface?

Primary Software: TestStand
Primary Software Version: 2.0
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem: Does the TestStand 2.0.x and Earlier ActiveX Automation Adapter Support the Creation or Manipulation of COM Objects that Implement a Custom Interface?

Solution: The TestStand 2.0.x and earlier ActiveX Automation Adapter only supports the creation and manipulation of COM objects that implement an IDispatch Interface (including those with Dual Interfaces).

To categorize IDispatch Interfaces and Custom Interfaces in a certain category of technologies consider the following:

The IDispatch Interface provides a standard set of methods for retrieving IDispatch pointers to methods and properties of an object and supports the exclusive use of ActiveX data types (variants, safearrays, booleans, currency, date, etc...) thus placing it firmly in the description of being an "ActiveX Interface". The main benefit of implementing an IDispatch interface is to provide a way for languages and IDEs that do not support C pointer types and custom data structures to use your objects. For instance, Visual Basic cannot utilize function pointers or the dereferencing of pointers and implements all of its data as variants regardless of your custom data structures.

A Custom Interface is an interface that only has the requirement of inheriting from the IUnknown Interface and has no restrictions on the data types it can define for properties and can rely only on the use of a vtbl for accessing its methods. Basically, Custom Interfaces fall into a category of being "COM Interfaces" only since they do not adhere to the restrictions that make up what is "ActiveX Technology". A drawback of using Custom Interfaces is that not all languages and development environments are capable of invoking their methods via function pointers and a wrapper may need to be made in order to accomplish this. Custom Interfaces are often used when defining an interface in C++ to be used inside of other C++ applications to avoid the use of Variants and passing around of IDispatch pointers to access object members (which also implies that you do not have to go through the extra effort of creating IDispatch variables for all members in the implementation of your COM object).

Related Links:

Attachments:





Report Date: 07/10/2002
Last Updated: 09/14/2004
Document ID: 2N9EQDEV

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit