TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
sri
NA
6
0
System.AccessViolationException C#
Jul 9 2009 8:06 PM
Hi guys,
I want to open ArcMap (ArcGIS) attributes table and for that I am using C# code. In this process I get an error message as
IsDockable = 'pTableWindow2.IsDockable' threw an exception of type 'System.
AccessViolationException'.
I searched a lot on the internet and found that it's a very frequent problem but I couldn't figure it out. I do not understand what's the problem with it. I would appreciate if anyone can help me with this issue. The code is given below.
public override void OnClick()
{
IMxDocument pMxDoc;
ILayer pLayer;
IFeatureLayer pFeatureLayer;
IStandaloneTable pStandaloneTable;
ITableWindow2 pTableWindow2;
ITableWindow pExistingTableWindow;
try
{
pMxDoc = m_application.Document as IMxDocument;
pTableWindow2 = new TableWindowClass();
pFeatureLayer = (IFeatureLayer)pMxDoc.
SelectedItem;
pLayer = pFeatureLayer;
pExistingTableWindow = pTableWindow2.FindViaLayer(
pLayer);
pTableWindow2.Layer = pLayer;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Thank you in advance
Reply
Answers (
0
)
Disposing problem
receive keyboard events by two components simultaneously