TextSymbolClass throws AccessViolation Exception in Dynamic Display

199
1
08-17-2010 05:37 AM
DarrenRempel
New Contributor III
ISimpleTextSymbol textSymbol = new TextSymbolClass();
...
                    IGraphicTrackerSymbol graphicTrackerSymbol = this.graphicTracker.CreateSymbol((TextSymbolClass)textSymbol, null);

                    int shapeId = this.graphicTracker.Add(point, graphicTrackerSymbol);


This code works in non-dynamic display but not in dynamic display mode.  Anyone else seen this problem?
0 Kudos
1 Reply
WilsonJiang
New Contributor
Drempel,

I could not see the text symbol on the map. Could you please give me all lines of codes regarding ISimpleTextSymbol textSymbol = new TextSymbolClass()?

My codes are:

IGraphicTrackerSymbol gtSymbol = graphicTracker.CreateSymbol( GetTextSymbol() as ISymbol, null );

public ITextSymbol GetTextSymbol()
{
         ISimpleTextSymbol m_textSymbol = new TextSymbolClass() as ISimpleTextSymbol;
         m_textSymbol.Font = ToFontDisp( new System.Drawing.Font( "Tahoma", 10.0f, FontStyle.Bold ) );
         m_textSymbol.Size = 10;
         m_textSymbol.Color = ( IColor )ToRGBColor( Color.FromArgb( 255, 0, 0 ) );
         m_textSymbol.Text = "ABCE 123";
         return m_textSymbol;
}

Please point out the problem if you could.

Thanks,
Wilson Jiang
0 Kudos