IHYCrossPlatformSilverlightHost is an interface that describes silverlight host object and allows silverlight plugins to query automation objects or report errors in XAML DOM. There is no need to implement this interfaces manually, since it is already implemented in the Hydra module managers, so instead of using this interface directly you will interact with THYModuleManager or THYFMXModuleManager classes.

For more information about silverlight hosting please refer to this article - Silverlight Visual Plugins.


Required Methods

GetAutomationObject  safecall

This method is called each time when plugin calls AutomationFactory.CreateObject or AutomationFactory.GetObject. Depending on ProgId and Flags parameters host need to create a new or return an exisitng instance of a requested object. If host can not handle this it should set Disp parameter to nil.

procedure GetAutomationObject(const ProgId: WideString; const Flags: Integer; var Disp: IDispatch)


  • ProgId: String specifying the programmatic identifier of the object to get.
  • Flags: Depending on a plugin call Flags parameter will be set to aoGet or to aoCreate. So you can handle this situation manually to create a new object or return an existing instance.
  • Disp: If this method succeeds, Disp parameter must hold a reference to a requested object. If you set this property to nil, Silverlight will perform a default call that allows to create an automation object that is registered in the system such as Excel.Application or WScript.Shell.

NotifyError  safecall

This mthod is invoked whenever Silverlight reports about error within XAML DOM of the hosted control.

procedure NotifyError(const Error: WideString; const Source: WideString; const Line: Integer; const Column: Integer)


  • Error: String that holds error description.
  • Source: Name of the source XAML file.
  • Line: The line number.
  • Column: The column number.