with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLSelectElement2_Interface is

   procedure Initialize (This : in out IHTMLSelectElement2_Type) is
   begin
      Set_IID (This, IID_IHTMLSelectElement2);
   end Initialize;

   function Pointer (This : IHTMLSelectElement2_Type)
     return Pointer_To_IHTMLSelectElement2
   is
   begin
      return To_Pointer_To_IHTMLSelectElement2 (Address (This));
   end Pointer;

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

   function urns
     (This  : IHTMLSelectElement2_Type;
      urn   : GNATCOM.Types.VARIANT;
      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.urns
         (Pointer (This),
          urn,
          RetVal'Unchecked_Access));

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

      return RetVal;
   end urns;

end MSHTML.IHTMLSelectElement2_Interface;

