Select to view content in your preferred language

Using Framework reference, but can???t access DocumentClass

915
4
Jump to solution
02-21-2013 10:37 AM
KP
by
Deactivated User
I???m using Visual C# 2008 Express and I???m creating an Add=in button that will display the name of the map document when clicked.  The title property is available in the Document class using the interface IDocument.  I???m using the ESRI.ArcGIS.Framework reference, but the following code:
protected override void OnClick()         {                         IDocument doc = new DocumentClass();                ArcMap.Application.CurrentTool = null;         }


gives me the following error: ???the type or namespace name ???DocumentClass??? could not be found???.  I'm confused because this works with the MxDocumentClass and the ArcMapUI reference.  Any help would be greatly appreciated.
0 Kudos
1 Solution

Accepted Solutions
NeilClemmons
Honored Contributor
The Document class is an abstract class (see the legend for the OMD).  Abstract classes cannot be instantiated.  The only classes you can create new instances of are listed in the help topic for IDocument (such as MxDocument).

View solution in original post

0 Kudos
4 Replies
NeilClemmons
Honored Contributor
I've looked at the developer help for 9.3.1, 10, and 10.1 and none of them list a class named DocumentClass that implements IDocument.
0 Kudos
KP
by
Deactivated User
Looking at the Framework Object Model diagram(ArcGIS 10) there is a Document class( with the IDocument interface).  Doesn't that mean that there is a Document class?  And that it would be within the Framework refernce?
I'm afriad that I'm very far off from understanding how to cast between interfaces!
0 Kudos
NeilClemmons
Honored Contributor
The Document class is an abstract class (see the legend for the OMD).  Abstract classes cannot be instantiated.  The only classes you can create new instances of are listed in the help topic for IDocument (such as MxDocument).
0 Kudos
KP
by
Deactivated User
Thanks.  That pointed me in the right direction.
0 Kudos