This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, November 14, 2006 1:58:52 PM(UTC)
Groups: Registered
Posts: 31
AxLEADRasterView1 is AxLTRASTERVIEWLib.AxLEADRasterView.
I still try to fix an error. I'm using v14.5, annotation COM object & dotNet classes. I can't duplicate error on my test project. But an error only happens when I've created freehand object and clicked on an object, it's process this line "AxLEADRasterView1.ForceRepaint();" then it throw exception below:
"System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
at System.Windows.Forms.Control.DefWndProc(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.AxHost.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at LTRASTERVIEWLib.ILEADRasterView.ForceRepaint()
at AxLTRASTERVIEWLib.AxLEADRasterView.ForceRepaint()"
I've added code to get last win32 error after it throw exception followings:
int iwin32error = Marshal.GetLastWin32Error();
try
{
throw new Win32Exception(iwin32error);
}
catch (System.Exception ex32)
{
Console.WriteLine("GetLastWin32Error=" + ex32.ToString() + "\n");
}
I've got error message:
"System.ComponentModel.Win32Exception: Cannot create a file when that file already exists" and error code is 183.
I've run in debug mode and looked through exception ex32 object but I didn't see any file that refers from exception.
Do you have any suggestion what it means exactly? What file could it possible create when ForceRepaint() is calls?
Please help,
#2
Posted
:
Wednesday, November 15, 2006 5:27:11 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
It won't be easy to guess what's causing the
problem without being able to trace the code. If you create a small test
project that shows the problem (not your full application), please send it to
us in a ZIP file or post it here and we will check it for you.
#3
Posted
:
Wednesday, November 15, 2006 7:33:27 AM(UTC)
Groups: Registered
Posts: 31
I can't duplicate problem in test project.
1. I just want know what file ForceRepaint() refer to as "Cannot create a file when that file already exists". Or may be it create file using internal only?
2. My project does not create/write any file at that point. I don't know what could possible case that.
#4
Posted
:
Thursday, November 16, 2006 4:49:18 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
ForceRepaint() does not open any files; internally
it invalidates the window client and causes a WM_PAINT Windows API message to
be processed. This means the error is most likely related to other parts of
your code or our toolkit.
For example, if I were to create a program, and in
the OnPaint event handler my program has a bug, calling ForceRepaint might
cause the bug to be triggered. This doesn't mean ForceRepaint has a bug.
This is why I wrote last time that I need a small
project to trace the code.
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.