with GNATCOM.IInterface;

with GNATCOM.Errors;

package body MSHTML.IHTMLCommentElement_Interface is

   procedure Initialize (This : in out IHTMLCommentElement_Type) is
   begin
      Set_IID (This, IID_IHTMLCommentElement);
   end Initialize;

   function Pointer (This : IHTMLCommentElement_Type)
     return Pointer_To_IHTMLCommentElement
   is
   begin
      return To_Pointer_To_IHTMLCommentElement (Address (This));
   end Pointer;

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

   procedure Put_text
     (This : IHTMLCommentElement_Type;
      p    : GNATCOM.Types.BSTR;
      Free : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_text
         (Pointer (This),
          p));

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

   end Put_text;

   function Get_text
     (This : IHTMLCommentElement_Type)
     return GNATCOM.Types.BSTR
   is
       RetVal : aliased GNATCOM.Types.BSTR;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_text
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_text;

   procedure Put_atomic
     (This : IHTMLCommentElement_Type;
      p    : Interfaces.C.long)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Put_atomic
         (Pointer (This),
          p));

   end Put_atomic;

   function Get_atomic
     (This : IHTMLCommentElement_Type)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Get_atomic
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end Get_atomic;

end MSHTML.IHTMLCommentElement_Interface;

