Pimplebutt

Cannot obtain reference to Application

Discussion created by Pimplebutt on Jun 16, 2011
Latest reply on Jun 16, 2011 by Pimplebutt
My Environment:

  • ArcObjects 9.3.1

  • VB.NET

  • Visual Studio 2008

I have built a user control (see attached pic) that uses the toolbar, table of contents control, and map control.

I am trying to access built in commands to use through code.

It's my understanding that to do this I need to be able to get to the CommandBars class by
Application.Document.CommandBars.Find(UID)

If a standalone application based on ArcEngine does not have Application, then how do people writing this type of application execute commands.

If this is relevant, when I open a map document (mxd), this is the meat of the code involved in that...

Private _esriIMapDoc As IMapDocument
Private _esriMapControl As ESRI.ArcGIS.Controls.AxMapControl   

Public Sub OpenMxd(ByVal MxdFileNameAndPath As String)

    _esriIMapDoc = New MapDocument

    _esriIMapDoc.Open(MxdPathAndFileName, "")

    _esriMapControl.Map = _esriIMapDoc.Map(0)

End Sub

Attachments

Outcomes