.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using forms in C++/CLI AutoCad plugin

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
bej
Contributor
632 Views, 2 Replies

Using forms in C++/CLI AutoCad plugin

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

2 REPLIES 2
Message 2 of 3
fenton.webb
in reply to: bej

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




Fenton Webb
AutoCAD Engineering
Autodesk

Message 3 of 3
bej
Contributor
in reply to: fenton.webb

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost