I believe friends who have read the previous Silverlight out of browser instance tutorials have a certain understanding of the OOB application of Silverlight. Today, we will discuss another feature instance of Silverlight out of browser, the Silverlight OOB interaction with the COM API.
Before we start the instance, we'll look at some basic concepts.
First of all, what is COM?
Here I do not want too much space to discuss COM and COM +, Microsoft MSDN on the COM technology has a detailed explanation, interested to see. Here we just have a simple description of COM. The so-called COM is componet object model, Chinese is called the Component object models, is often used to create reusable software components. In Microsoft's products, many applications provide COM interfaces for developers to call. The more typical of these is the COM interface for the Office family.
For professional definitions of COM and COM +, COM is a specification of how to build a dynamic, interactive component that provides a number of binary and network standards that customers and components should follow to ensure interoperability. This standard allows communication between any two components without regard to the same operating environment in which they are used, the consistency of the development language in use, and whether they run on the same computer. COM + can be called an upgraded version of COM, its underlying structure is still based on COM, it is almost inclusive of all COM content, COM + integrated COM, DCOM and MTS technical elements, it is to upgrade the COM component software to the application layer is not the underlying software structure, it through the For system support, the Component Object model is built on the application tier, leaving the underlying details of all components to the operating system, so COM + is more closely integrated with the operating system. It is noteworthy that COM + is no longer limited to COM component technology, it is more focused on the design and implementation of distributed network applications.
Silverlight 4 support for COM
Early Silverlight developers knew that Silverlight, as a client-side technology, could not perform higher-privileged operations, such as reading and writing local disks, executing local commands, and so on. The release of Silverlight 4, which increases support for COM, allows Silverlight to interoperate with COM APIs under the OOB Trust application, which enhances the capabilities of Silverlight, which is applied as a Windows application, with a light Loose operation of the Windows API. Here, please note that Microsoft's recommendations, Silverlight 4 for COM support, limited to the Windows operating system COM components, temporarily unable to support user-defined COM components created, this is the current limitations, but believe that the subsequent Silverlight version, Will solve the problem.
Silverlight 4 and COM Interactive technology basics
Microsoft provides developers with relevant APIs to simplify the Silverlight 4 and COM interactive development. The main points are as follows:
In the Silverlight 4 beta version, the COM interaction class uses the Comautomationfactory static class, and in the Silverlight 4 official edition, Microsoft changed comautomationfactory to Automationfactory class.
The Automationfactory class is provided with four methods and one property under the System.Runtime.InteropServices.Automation namespace