Goal: Convert labels to Annotations using ArcObjects.
Method: I ran an ESRI code sample from the documentation and received this error:
"A first chance exception of type 'System.Runtime.InteropServices.COMException' occurred in GdB Subsurface Investigation v103.dll
Additional information: Error HRESULT E_FAIL has been returned from a call to a COM component.
If there is a handler for this exception, the program may be safely continued."
Code sample found here: Covert Labels Sample Code
This is call I make to the function: ConvertLabelsToGDBAnnotationSingleLayer(pMap, 0, False)
pMap is a properly declared and set IMap object.
There is only one layer in the MXD, and I have confirmed (as expected) that it is found at index 0.
The last parameter is a boolean to set Feature Linked annotations.
The error occurs on this line:
pConvertLabelsToAnnotation.AddFeatureLayer(pGeoFeatureLayer, pGeoFeatureLayer.Name & "_Anno", pFeatureWorkspace, pFeatureClass.FeatureDataset, featureLinked, False, False, True, True, "")
Also, is there a way to use code tags in this forum?