ArcMap dataview does not rendered correctly if it is opened from the ArcObject sample application “DesktopAutomation.”
上次发布: August 19, 2020ArcGIS for Desktop
漏洞 ID 编号
NIM088363
已提交
January 24, 2013
上次修改时间
June 5, 2024
适用范围
ArcGIS for Desktop
找到的版本
10.1
编程语言
C#
操作系统
Windows OS
操作系统版本
7 64 Bit
状态
Will Not Be Addressed
开发团队已考虑过该问题或请求,并决定不会解决该问题。 问题的“其他信息”部分可能包含进一步说明。
附加信息
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.
解决办法
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; }}