with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTCAttachBehavior2_Interface is

   procedure Initialize (This : in out IHTCAttachBehavior2_Type) is
   begin
      Set_IID (This, IID_IHTCAttachBehavior2);
   end Initialize;

   function Pointer (This : IHTCAttachBehavior2_Type)
     return Pointer_To_IHTCAttachBehavior2
   is
   begin
      return To_Pointer_To_IHTCAttachBehavior2 (Address (This));
   end Pointer;

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

   procedure FireEvent
     (This : IHTCAttachBehavior2_Type;
      evt  : GNATCOM.Types.VARIANT;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.FireEvent
         (Pointer (This),
          evt));

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

   end FireEvent;

end MSHTML.IHTCAttachBehavior2_Interface;

