with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLFormElement3_Interface is

   procedure Initialize (This : in out IHTMLFormElement3_Type) is
   begin
      Set_IID (This, IID_IHTMLFormElement3);
   end Initialize;

   function Pointer (This : IHTMLFormElement3_Type)
     return Pointer_To_IHTMLFormElement3
   is
   begin
      return To_Pointer_To_IHTMLFormElement3 (Address (This));
   end Pointer;

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

   function namedItem
     (This  : IHTMLFormElement3_Type;
      name  : GNATCOM.Types.BSTR;
      Free  : Boolean := True)
     return GNATCOM.Types.Pointer_To_IDispatch
   is
       RetVal : aliased GNATCOM.Types.Pointer_To_IDispatch;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.namedItem
         (Pointer (This),
          name,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end namedItem;

end MSHTML.IHTMLFormElement3_Interface;

