Some problemas about CADImageDLL
Posted: 18 Oct 2006, 05:18
Hi,
I am using CADImageDLL demo on a VS 2003 project, .NET 1.1.
I have a problem with your DLL in that frequently a "resource already in use" exception is raised in the following lines:
using(Graphics g1 = Graphics.FromHwnd(_panelControl.Handle))
DLLWin32ImportCAD.DrawCAD(DLLWin32ImportCAD.CADFile, g1.GetHdc(), ref R);
That is not the exact message but almost, and it seems that a problem is ocurring here because the Graphics instance is disposed immediately. Could that be caused because the DrawCAD works in a thread ?. If that is the case, then, is there another way in that the drawing can occur in a non-thread model ?
That situation is causing me a lot of troubles.
In fact, the same problem you can observe in your main c# demo for VS 2003 after a few repaints of the device context.
I am using CADImageDLL demo on a VS 2003 project, .NET 1.1.
I have a problem with your DLL in that frequently a "resource already in use" exception is raised in the following lines:
using(Graphics g1 = Graphics.FromHwnd(_panelControl.Handle))
DLLWin32ImportCAD.DrawCAD(DLLWin32ImportCAD.CADFile, g1.GetHdc(), ref R);
That is not the exact message but almost, and it seems that a problem is ocurring here because the Graphics instance is disposed immediately. Could that be caused because the DrawCAD works in a thread ?. If that is the case, then, is there another way in that the drawing can occur in a non-thread model ?
That situation is causing me a lot of troubles.
In fact, the same problem you can observe in your main c# demo for VS 2003 after a few repaints of the device context.