I need some help with showing an "AddDataDialog" in a C# standalone application to select some feature classes from inside a file-geodatabase. Whatever I try, it ends up with an Exception which makes no sence to me. I used a ESRI snippet to provide the hWnd of "this" application and a referenced bool.
enter image description here Is it possible to use this Dialog out of the context of ArcMap? And, if yes, has someone out there an idea what I might have done wrong so far?
-
Are you used IAddDataDialog in a standalone program? beacuse of esri documentation this interface is available on desktop only.How you did that? Thanks...Mahdi Ahmadi– Mahdi Ahmadi2015年12月27日 12:11:42 +00:00Commented Dec 27, 2015 at 12:11
1 Answer 1
Looking at the API for the Interface IAddDataDialog it appears you need to set the Document property which you are not doing in the screen shot you supplied. May be that is the source of the problem?
In the walk through example on how to build a map viewing application they simply add a reference to the add data button to a toolbar, that may be a simpler approach?
axToolbarControl1.AddItem("esriControls.ControlsAddDataCommand", - 1, - 1, false, 0, esriCommandStyles.esriCommandStyleIconOnly);
-
The second approach is more effective indeed. And yes, the missing "Document" was the source my problem. Thank you!Olle Onkel– Olle Onkel2015年08月12日 18:08:40 +00:00Commented Aug 12, 2015 at 18:08