with GNATCOM.Errors;

package body MSHTML.IElementNamespaceFactoryCallback_Interface is

   procedure Initialize (This : in out IElementNamespaceFactoryCallback_Type) is
   begin
      Set_IID (This, IID_IElementNamespaceFactoryCallback);
   end Initialize;

   function Pointer (This : IElementNamespaceFactoryCallback_Type)
     return Pointer_To_IElementNamespaceFactoryCallback
   is
   begin
      return To_Pointer_To_IElementNamespaceFactoryCallback (Address (This));
   end Pointer;

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

   procedure Resolve
     (This          : IElementNamespaceFactoryCallback_Type;
      bstrNamespace : GNATCOM.Types.BSTR;
      bstrTagName   : GNATCOM.Types.BSTR;
      bstrAttrs     : GNATCOM.Types.BSTR;
      pNamespace    : Pointer_To_IElementNamespace;
      Free          : Boolean := True)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Resolve
         (Pointer (This),
          bstrNamespace,
          bstrTagName,
          bstrAttrs,
          pNamespace));

      if Free then
               GNATCOM.IInterface.Free (bstrNamespace);
               GNATCOM.IInterface.Free (bstrTagName);
               GNATCOM.IInterface.Free (bstrAttrs);
      
      end if;

   end Resolve;

end MSHTML.IElementNamespaceFactoryCallback_Interface;

