laptop and a wrench

Bogue

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

Dernière publication: August 19, 2020 ArcGIS for Desktop
Numéro d’ID de bogue NIM088363
EnvoiJanuary 24, 2013
Dernière modificationJune 5, 2024
S’applique àArcGIS for Desktop
Version trouvée10.1
Langue du programmeC#
Système d’exploitationWindows OS
Version du système d’exploitation7 64 Bit
StatutWill Not Be Addressed

Informations supplémentaires

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.

Solution de contournement

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; }}

Étapes pour reproduire

ID de bogue: NIM088363

Logiciel:

  • ArcGIS for Desktop

Recevoir une notification lorsque le statut d’un bogue change

Télécharger l’application Esri Support

En savoir plus sur ce sujet

Obtenir de l’aide auprès des experts ArcGIS

Contacter le support technique

Télécharger l’application Esri Support

Accéder aux options de téléchargement