laptop and a wrench

Bug

ArcMap dataview does not rendered correctly if it is opened from the ArcObject sample application “DesktopAutomation.”

Zuletzt veröffentlicht: August 19, 2020 ArcGIS for Desktop
Bug-ID-Nummer NIM088363
EingereichtJanuary 24, 2013
Zuletzt geändertJune 5, 2024
Gilt fürArcGIS for Desktop
Gefunden in Version10.1
ProgrammspracheC#
BetriebssystemWindows OS
Betriebssystemversion7 64 Bit
StatusWill Not Be Addressed

Zusätzliche Informationen

We apologize that we were unable to address this issue within the current product support cycle.  If the issue continues to affect your work in a supported release, please contact Technical Support.

Workaround

Currently the sample starts the application using the MxDocument class where they can get the application reference from the MxDocument that was just started. The workaround involves starting the process using the standard .NET Process class then utilizes the AppROT AppAdded event handler to obtain the application reference. //import user32.dll to call GetWindowThreadProcessId[System.Runtime.InteropServices.DllImport("user32")]static extern int GetWindowThreadProcessId(IntPtr hWnd, out int processId); private void btnStartApp_Click(object sender, EventArgs e){ m_appROTEvent = new AppROTClass(); m_appROTEvent.AppAdded += new IAppROTEvents_AppAddedEventHandler(m_appROTEvent_AppAdded); m_appROTEvent.AppRemoved += new IAppROTEvents_AppRemovedEventHandler(m_appROTEvent_AppRemoved); System.Diagnostics.Debug.WriteLine("Starting process " + DateTime.Now); Process arcMapProcess = Process.Start(@"<a href="file:C:/Program" target="_blank">C:\Program</a> Files (x86)\ArcGIS\Desktop10.1\bin\ArcMap.exe"); //get the ID of the process that was just started arcMapProcessId = <a href="http://arcMapProcess.Id" target="_blank">arcMapProcess.Id</a>; while (!m_appStarted) Application.DoEvents(); ////Enable/disable controls accordingly txtShapeFilePath.Enabled = true; btnShutdown.Enabled = true; btnDrive.Enabled = ShouldEnableAddLayer; cboApps.Enabled = btnStartApp.Enabled = false;}void m_appROTEvent_AppAdded(AppRef pApp){ //get the ID of the app that was just added GetWindowThreadProcessId((IntPtr)pApp.hWnd, out appAddedProcessId); // compare the IDs to know that you have the correct application instance if (appAddedProcessId == arcMapProcessId) { //Get a reference of the application and make it visible m_application = pApp; m_application.Visible = true; m_appHWnd = m_application.hWnd; System.Diagnostics.Debug.WriteLine("HWND from AppAdded " + m_appHWnd.ToString() + " " + DateTime.Now); m_appStarted = true; }}

Schritte zur Reproduzierung

Bug-ID: NIM088363

Software:

  • ArcGIS for Desktop

Benachrichtigung erhalten, wenn sich der Status eines Bugs ändert

Esri Support App herunterladen

Weitere Informationen zu diesem Thema erkunden

Unterstützung durch ArcGIS-Experten anfordern

An den technischen Support wenden

Esri Support App herunterladen

Zu Download-Optionen wechseln