chaitanyap

IEXTENSION INTERFACE

Discussion created by chaitanyap on Mar 11, 2013
Latest reply on Mar 12, 2013 by agray1
// Code in  ext.cs


using System;
using System.Drawing;
using System.Runtime.InteropServices;
using ESRI.ArcGIS.ADF.BaseClasses;
using ESRI.ArcGIS.ADF.CATIDs;
using ESRI.ArcGIS.Framework;
using ESRI.ArcGIS.ArcMapUI;
using ESRI.ArcGIS.esriSystem;

namespace NE_EXT
{
    /// <summary>
    /// Summary description for NEConvertExt.
    /// </summary>
    [Guid("d1bb6202-5f18-4509-977c-79aecfbf9c62")]
    [ClassInterface(ClassInterfaceType.None)]
    [ProgId("NE_EXT.NEConvertExt")]
    public sealed class NEConvertExt : IExtension
    {       

        private IApplication m_application;
        IMxDocument pMxDoc;
        string sMxdFileName = "C:\\Documents and Settings\\abc\\Desktop\\mXD'S\\abc.mxd";
       
       
        #region IExtension Members

        public string Name
        {
            get
            {
                return "ConvertToNEExtension";
            }
        }

        public void Shutdown()
        {
            //throw new NotImplementedException();
            m_application = null;
        }

        public void Startup(ref object initializationData)
        {
            m_application = initializationData as IApplication;
            if (m_application == null)
                return;
        }

        #endregion


        public void CreateWorkorder(string WoName,string WoType)
        {            
        }
        public void OpenWorkorder(string WoName)
        {
        }
        public void Convert(string strServer,string strInstance,string strUserName,string strVersion)
        {
        }

I wrote above code in IExtension class.




I want to access these Methods in another External Application ,for That

// Code in EXtApp.cs

if (!b_ArcMapStarted)
                    {
                        IDocument pDoc = new MxDocumentClass();
                        pApp = pDoc.Parent();
                        pApp.OpenDocument(sMxdFileName);//Opened a saved Mxd

                        pApp.Visible = false;

                       IExtension objExt; // Created I Extension Object
                        objExt = pApp.FindExtensionByName("ConvertToNEExtension");
                        if (objExt != null)
                        {
                            objExt.c// Here that methods are not accesible, I didn't get  what's the problem is
                        }

Outcomes