F
Frank Sharp
VS2005 SP1, Office2003:
Looks like nobody has an idea how to solve my AccessViolationException
(Attempted to read or write protected memory...) problem when using
Datagridview in an Office AddIn. (Posted on 17.5.).
I found out it happens when I use one of this controls in an office addin:
DataGrid, DataGridView, Reportviewer.
So maybe somebody has an answer to this questions:
What is the difference between this controls and the other controls?
Is there a debug tool I could use to find out where the memory is located
and why it is protected?
Thank u,
Frank
P.S.: Already did repair of Framework2.0, repair of Office, deinstalled Sp1
of VS2005, reinstalled it again etc...
System.AccessViolationException: Es wurde versucht, im geschützten Speicher
zu lesen oder zu schreiben. Dies ist häufig ein Hinweis darauf, dass anderer
Speicher beschädigt ist.
bei System.Drawing.SafeNativeMethods.Gdip.GdipDrawLineI(HandleRef
graphics, HandleRef pen, Int32 x1, Int32 y1, Int32 x2, Int32 y2)
bei System.Drawing.Graphics.DrawLine(Pen pen, Int32 x1, Int32 y1, Int32
x2, Int32 y2)
bei System.Windows.Forms.DataGridViewCell.PaintBorder(Graphics graphics,
Rectangle clipBounds, Rectangle bounds, DataGridViewCellStyle cellStyle,
DataGridViewAdvancedBorderStyle advancedBorderStyle)
bei
System.Windows.Forms.DataGridViewTopLeftHeaderCell.PaintBorder(Graphics
graphics, Rectangle clipBounds, Rectangle bounds, DataGridViewCellStyle
cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle)
bei
System.Windows.Forms.DataGridViewTopLeftHeaderCell.PaintPrivate(Graphics
graphics, Rectangle clipBounds, Rectangle cellBounds, Int32 rowIndex,
DataGridViewElementStates cellState, Object formattedValue, String
errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle
advancedBorderStyle, DataGridViewPaintParts paintParts, Boolean
computeContentBounds, Boolean computeErrorIconBounds, Boolean paint)
bei System.Windows.Forms.DataGridViewTopLeftHeaderCell.Paint(Graphics
graphics, Rectangle clipBounds, Rectangle cellBounds, Int32 rowIndex,
DataGridViewElementStates cellState, Object value, Object formattedValue,
String errorText, DataGridViewCellStyle cellStyle,
DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts
paintParts)
bei System.Windows.Forms.DataGridViewCell.PaintWork(Graphics graphics,
Rectangle clipBounds, Rectangle cellBounds, Int32 rowIndex,
DataGridViewElementStates cellState, DataGridViewCellStyle cellStyle,
DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts
paintParts)
bei System.Windows.Forms.DataGridView.PaintTopLeftHeaderCell(Graphics g)
bei System.Windows.Forms.DataGridView.PaintGrid(Graphics g, Rectangle
gridBounds, Rectangle clipRect, Boolean singleVerticalBorderAdded, Boolean
singleHorizontalBorderAdded)
bei System.Windows.Forms.DataGridView.OnPaint(PaintEventArgs e)
bei System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e,
Int16 layer, Boolean disposeEventArgs)
bei System.Windows.Forms.Control.WmPaint(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.DataGridView.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&
m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)
Looks like nobody has an idea how to solve my AccessViolationException
(Attempted to read or write protected memory...) problem when using
Datagridview in an Office AddIn. (Posted on 17.5.).
I found out it happens when I use one of this controls in an office addin:
DataGrid, DataGridView, Reportviewer.
So maybe somebody has an answer to this questions:
What is the difference between this controls and the other controls?
Is there a debug tool I could use to find out where the memory is located
and why it is protected?
Thank u,
Frank
P.S.: Already did repair of Framework2.0, repair of Office, deinstalled Sp1
of VS2005, reinstalled it again etc...
System.AccessViolationException: Es wurde versucht, im geschützten Speicher
zu lesen oder zu schreiben. Dies ist häufig ein Hinweis darauf, dass anderer
Speicher beschädigt ist.
bei System.Drawing.SafeNativeMethods.Gdip.GdipDrawLineI(HandleRef
graphics, HandleRef pen, Int32 x1, Int32 y1, Int32 x2, Int32 y2)
bei System.Drawing.Graphics.DrawLine(Pen pen, Int32 x1, Int32 y1, Int32
x2, Int32 y2)
bei System.Windows.Forms.DataGridViewCell.PaintBorder(Graphics graphics,
Rectangle clipBounds, Rectangle bounds, DataGridViewCellStyle cellStyle,
DataGridViewAdvancedBorderStyle advancedBorderStyle)
bei
System.Windows.Forms.DataGridViewTopLeftHeaderCell.PaintBorder(Graphics
graphics, Rectangle clipBounds, Rectangle bounds, DataGridViewCellStyle
cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle)
bei
System.Windows.Forms.DataGridViewTopLeftHeaderCell.PaintPrivate(Graphics
graphics, Rectangle clipBounds, Rectangle cellBounds, Int32 rowIndex,
DataGridViewElementStates cellState, Object formattedValue, String
errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle
advancedBorderStyle, DataGridViewPaintParts paintParts, Boolean
computeContentBounds, Boolean computeErrorIconBounds, Boolean paint)
bei System.Windows.Forms.DataGridViewTopLeftHeaderCell.Paint(Graphics
graphics, Rectangle clipBounds, Rectangle cellBounds, Int32 rowIndex,
DataGridViewElementStates cellState, Object value, Object formattedValue,
String errorText, DataGridViewCellStyle cellStyle,
DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts
paintParts)
bei System.Windows.Forms.DataGridViewCell.PaintWork(Graphics graphics,
Rectangle clipBounds, Rectangle cellBounds, Int32 rowIndex,
DataGridViewElementStates cellState, DataGridViewCellStyle cellStyle,
DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts
paintParts)
bei System.Windows.Forms.DataGridView.PaintTopLeftHeaderCell(Graphics g)
bei System.Windows.Forms.DataGridView.PaintGrid(Graphics g, Rectangle
gridBounds, Rectangle clipRect, Boolean singleVerticalBorderAdded, Boolean
singleHorizontalBorderAdded)
bei System.Windows.Forms.DataGridView.OnPaint(PaintEventArgs e)
bei System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e,
Int16 layer, Boolean disposeEventArgs)
bei System.Windows.Forms.Control.WmPaint(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.DataGridView.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&
m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg,
IntPtr wparam, IntPtr lparam)