Winforms control hosting in unmanaged applications
AssigneeMicrosoft Corporation
InventorsGeoffrey Charles Darst, Eric Hyde Carter, Michael Shneerson, Stephen James Styrchak
Life of this patent
Estimating the term…
Abstract
Systems and methods for hosting managed code controls within unmanged hosts, such as MICROSOFT Word and Excel. There are two components to the hosting architecture, a wrapper control that implements various interfaces and a container control that hosts the managed code control. A design-time implementation allows for a designer to drag and drop managed code controls onto documents that run in a design component process. A runtime component allows managed code controls to run within hosts under security permissions specified by a policy.
Claims20
A method of hosting a managed code control in an unmanaged host, the method being implemented on a computing device where execution of the managed code control is managed within a common language runtime environment on the computing device and implementation of the unmanaged host is performed on the computing device external to the common language runtime environment thereon, the method comprising:
- providing a wrapper control (“wrapper”) in a memory of the computing device that implements control interfaces and abstracts managed control of the managed code control from the unmanaged host, the wrapper control being managed external to the common language runtime environment on the computing device;
- and
- providing a container control in a memory of the computing device as an intermediary managed object that is a container for said managed code control, the container control being managed within the common language runtime environment on the computing device, the method comprising:
- determining that the managed code control has been placed on a document by way of the wrapper being provided in the unmanaged host;
- generating code that will result in the managed code control being loaded at runtime;
- creating the container control and the managed code control as correspondent entities of the placed wrapper;
- parenting the created managed code control to the container control so as to establish a relationship between the created managed code control and the container control within the common language runtime environment;
- locating the placed wrapper in the unmanaged host;
- and
- pushing the container control to the wrapper in the unmanaged host so as to establish a relationship between the container control and the wrapper and by extension between the created managed code control within the common language runtime environment and the wrapper external to the common language runtime environment,
- the method further comprising the unmanaged host employing the placed wrapper in the unmanaged host and external to the common language runtime environment to employ the managed code control within the common language runtime environment by way of the container control within the common language runtime environment.
A method of hosting a managed control in an unmanaged host, the method being implemented on a computing device where execution of the managed control is managed within a common language runtime environment on the computing device and implementation of the unmanaged host is performed on the computing device external to the common language runtime environment thereon, the method comprising:
- placing said managed control on a document within said host;
- instantiating said managed control in a memory of the computing device;
- and
- loading a wrapper control on said document, the wrapper control being managed external to the common language runtime environment on the computing device, the method comprising:
- generating code that will result in the managed control being loaded at runtime;
- creating a container control and the managed control as correspondent entities of the loaded wrapper control, the container control being managed within the common language runtime environment on the computing device;
- parenting the created managed code control to the container control so as to establish a relationship between the created managed code control and the container control within the common language runtime environment;
- locating the placed wrapper in the unmanaged host;
- and
- pushing the container control to the wrapper in the unmanaged host so as to establish a relationship between the container control and the wrapper and by extension between the created managed control within the common language runtime environment and the wrapper external to the common language runtime environment,
- the method further comprising the unmanaged host employing the wrapper in the unmanaged host and external to the common language runtime environment to employ the managed control within the common language runtime environment by way of the container control within the common language runtime environment.
A computer readable hardware medium having stored thereon computer instructions for hosting a managed control in an unmanaged host, where execution of the managed control is managed within a common language runtime environment on a computing device and implementation of the unmanaged host is performed on the computing device external to the common language runtime environment thereon, said instructions performing the method comprising:
- placing said managed control on a document as a wrapper control within said host, the wrapper control being managed external to the common language runtime environment on the computing device;
- instantiating said managed control;
- generating code that will result in the managed control being loaded at runtime;
- loading the wrapper control on said document;
- creating a container control and the managed control as correspondent entities of the placed wrapper, the container control being managed within the common language runtime environment on the computing device;
- parenting the created managed control to the container control so as to establish a relationship between the created managed code control and the container control within the common language runtime environment;
- pushing the container control to the wrapper in the unmanaged host so as to establish a relationship between the container control and the wrapper and by extension between the created managed control within the common language runtime environment and the wrapper external to the common language runtime environment;
- and
- hosting said managed control within said container control,
- the method further comprising the unmanaged host employing the placed wrapper in the unmanaged host and external to the common language runtime environment to employ the managed control within the common language runtime environment by way of the container control within the common language runtime environment.
Dependencies are inferred from the claim text.