filippa

Select Black Point Tool doesn't work in Windows MapControl

Discussion created by filippa on Dec 2, 2013
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

Outcomes