Hi,
I'm having a problem displaying a custom windows form in my C++/CLI AutoCad 2014 plugin.
The code is posted below. The application does nothing AutoCad specific, it only opens a windows form I've created.
What happens when I call this command is that if I let the form display on screen for some time, AutoCad will crash, usually within 1-2 minutes after the form has opened.
Is there any known problems calling a Windows Form from a C++/CLI AutoCad plugin?
[CommandMethod("TestGUI")]
static void TestGUI()
{
MyForm ^myForm = gcnew TestProj::MyForm();
Autodesk::AutoCAD::ApplicationServices::Application::ShowModelessDialog(myForm);
}
Regards,
Bjørn Egil Jenssen
Solved! Go to Solution.
Solved by bej. Go to Solution.
can't see anything wrong with your code, so we need to see a small rebuildable sample applications which shows the same problem to be able to help
It seems the problem did not occur by opening the Windows Form I had created. However, AutoCAD crashes as mentioned in my original post when calling the standard Windows::Forms::OpenFileDialog from within my custom form.
After I discovered this, I replaced the standard Windows::Forms::OpenFileDialog with Autodesk::AutoCAD::Windows::OpenFileDialog, and this seems to have solved the problem. I have not experienced any AutoCAD crashes after this change.
Regards,
Bjørn