COM Testing Support
|Top Previous Next|
Microsoft's Component Object Model (COM) is a standard for communication between separately engineered software components (source). Any object with a COM interface can be created and used remotely.
Creating a COM Object
You can create a COM object using Windows' ActiveXObject class. Once the object is created, method invocation is the same as with any other object in your program. The methods available will depend on the object's COM interface. The following example shows how to create an instance of the Word application and open a file.
var doc = new ActiveXObject("Word.Application");
There are several test samples that show how to Unit Test application modules via COM interface: