1

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?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Aug 11, 2015 at 10:04
1
  • Are you used IAddDataDialog in a standalone program? beacuse of esri documentation this interface is available on desktop only.How you did that? Thanks... Commented Dec 27, 2015 at 12:11

1 Answer 1

2

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);
answered Aug 11, 2015 at 10:26
1
  • The second approach is more effective indeed. And yes, the missing "Document" was the source my problem. Thank you! Commented Aug 12, 2015 at 18:08

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.