I am opening dwg files using a customized modal form on a .net dll application. It works fine when open the first, then the second drawing in a row. When I try to open the third drawing I got a JIT runtime debbugger exception with no further explanation. The weird thing is, when I do some modification to the first, or the second drawing, I do not get the exception error message. Also when I maximaxed the document window, no error exception shows. I am picking the files using a Webbrowser control on the modal form, so I added some debbuging capability to it. The result was a extra message displaying "OUT of Memory error". It seems that AutoCAD does not allocate enought memory for the .net modal form unless some modification to the active drawing is done. I check also if there were any memory leaking problem, none was found, I also use the showmodaldialog("modalform") method exposed by autocad application object with no luck.