FeatureClassName error

790
2
12-06-2012 06:29 AM
RuthLeBlanc
New Contributor
I'm using ArcObjects with .NET, and have ArcGIS Desktop 10 SP 4 installed.  In my code I have the following line:
[INDENT]IFeatureClassName outFeatureClassName = (IFeatureClassName)new FeatureClassName();[/INDENT]

When I look at the outFeatureClassName object in debugging, the following exceptions have been thrown by objects in the class:
[INDENT]CanEditMetadata.Metadata     InteropServices.COMException
CanEditMetadata.ModelName     InteropServices.COMException
NativeType           InteropServices.COMException
ObjectClassID           InteropServices.COMException
SQLPrivileges           InvalidCastException[/INDENT]

A little more info on the SQLPrivileges error...
[INDENT]Unable to cast COM object of type 'ESRI.ArcGIS.Geodatabase.FeatureClassNameClass' to interface type 'ESRI.ArcGIS.Geodatabase.ISQLPrivilege'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{A867A185-C5CB-11D2-AAE2-00C04FA37849}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).[/INDENT]

Is there a known issue with this class?  Is there a way I can get around this issue?

p.s. I also tried "new FeatureClassNameClass()", instead of casting it, but got the same results.

Thanks,

Ruth
0 Kudos
2 Replies
NeilClemmons
Regular Contributor III
Is this preventing you from doing something you're trying to do or are you just curious as to why you're seeing this?  It's normal for the debugger to encounter errors when attempting to display information about properties that have not been initialized.  For example, if you create a new IPoint object and look at its properties, you'll see exceptions are thrown for properties such as M, X, Y and Z.  However, after you set the coordinates for the new point (i.e. call PutCoords), these properties then will display actual values.  Unless you're encountering some type of problem, I wouldn't worry about it.
0 Kudos
RuthLeBlanc
New Contributor
Thanks, Neil.  Good to know.  I thought it was a reason for an error I'm getting further in the code, but maybe not.  I'll look into it more now, with this new knowledge 🙂
0 Kudos