with GNATCOM.Errors;

package body MSHTML.IHTMLElementRender_Interface is

   procedure Initialize (This : in out IHTMLElementRender_Type) is
   begin
      Set_IID (This, IID_IHTMLElementRender);
   end Initialize;

   function Pointer (This : IHTMLElementRender_Type)
     return Pointer_To_IHTMLElementRender
   is
   begin
      return To_Pointer_To_IHTMLElementRender (Address (This));
   end Pointer;

   procedure Attach (This    : in out IHTMLElementRender_Type;
                     Pointer : in     Pointer_To_IHTMLElementRender)
   is
   begin
      Attach (This, GNATCOM.IInterface.To_Pointer_To_IUnknown
              (Pointer.all'Address));
   end Attach;

   procedure DrawToDC
     (This : IHTMLElementRender_Type;
      hdc  : wireHDC)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.DrawToDC
         (Pointer (This),
          hdc));

   end DrawToDC;

   procedure SetDocumentPrinter
     (This            : IHTMLElementRender_Type;
      bstrPrinterName : GNATCOM.Types.BSTR;
      hdc             : wireHDC;
      Free            : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.SetDocumentPrinter
         (Pointer (This),
          bstrPrinterName,
          hdc));

      if Free then
               GNATCOM.IInterface.Free (bstrPrinterName);
      
      end if;

   end SetDocumentPrinter;

end MSHTML.IHTMLElementRender_Interface;

