Select to view content in your preferred language

Problem with Initializing ESRI Application

607
0
09-23-2013 04:21 AM
pra
by
New Contributor
Hi,
         I have below piece of Code in my C#.Net Program where I need to Call OnCreate method from Program.cs.
         But I am facing problem with sending an object hook which is of type IMxApplication.

Can You please let me know how to pass IMxApplication type object.

public override void OnCreate( object hook )
      {
         if( hook != null )
         {
            if( hook is IMxApplication )
            {
               ESRIApplication = (IMxApplication)hook;

               MxDocument = (IMxDocument)( (IApplication)ESRIApplication ).Document;

            }
         }
      }


public override void OnClick()
      {
        try
          {
              frmTrackChartToo fTCT = new frmTrackChartToo();

             fTCT.Exporter = new VisioExporter(
                 (IApplication)ESRIApplication);

              fTCT.Exporter.Subdivision = MapBuilder.Subdivisions[0];

              fTCT.Show();

          }
       }
0 Kudos
0 Replies