Select Black Point Tool doesn't work in Windows MapControl

578
1
12-02-2013 06:14 AM
FilippaFideria
New Contributor
Hi forum
I have a problem with MapControl object.
I have developed an application with c# language and arcgis engine.
I have imported a toolbar developed for ArcMap desktop in a MapControl but some function developed for toolbar desktop don't work.
The follow function doesn't work but throws an exception at row of IDocument:

private void SelectBlackPointTool()
{
try
{
IDocument ipDoc;
ICommandBars ipCommandBars;
ICommandItem ipCommandItem;
UID ipUID = new UIDClass();
ipDoc = m_application.Document as IDocument;
ipCommandBars = ipDoc.CommandBars;
ipUID.Value = "esriArcMapUI.SelectTool";
ipCommandItem = ipCommandBars.Find(ipUID, false, false);
m_application.CurrentTool = ipCommandItem;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

What can I change to correct the function in order to make it works?

Please help me!
Please!

Thanks in advance
0 Kudos
1 Reply
NeilClemmons
Regular Contributor III
An Engine application does not have a document for you to reference nor can you use the tools that belong to ArcMap in an Engine application.  Engine ships with it's own set of built-in tools for you to use.  If you need something more than that then you must write your own tool.
0 Kudos