.NET

Reply
Contributor bej
Contributor
bej
Posts: 15
Registered: ‎11-21-2012
Message 1 of 3 (267 Views)
Accepted Solution

Using forms in C++/CLI AutoCad plugin

267 Views, 2 Replies
08-04-2013 11:41 PM

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::smileyfrustrated:howModelessDialog(myForm);
}

 

 

Regards,

Bjørn Egil Jenssen

ADN Support Specialist
fenton.webb
Posts: 352
Registered: ‎07-24-2007
Message 2 of 3 (245 Views)

Re: Using forms in C++/CLI AutoCad plugin

08-05-2013 02:44 PM 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

Developer Technical Services

Autodesk Developer Network


Contributor bej
Contributor
bej
Posts: 15
Registered: ‎11-21-2012
Message 3 of 3 (233 Views)

Re: Using forms in C++/CLI AutoCad plugin

08-06-2013 05:03 AM 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::smileysurprised:penFileDialog from within my custom form. 

 

After I discovered this, I replaced the standard Windows::Forms::smileysurprised:penFileDialog with Autodesk::AutoCAD::Windows::smileysurprised:penFileDialog, and this seems to have solved the problem. I have not experienced any AutoCAD crashes after this change.

 

 

Regards,

Bjørn

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.