.NET

.NET

Reply
Valued Contributor
55 Posts
0 Kudos
Registered: ‎11-12-2012
Post 1 of 5
Accepted Solution

No form visible in 32-bit compiled .DLL

337 Views, 4 Replies
04-10-2013 11:13 AM

I have an application that I have built that runs fine in AutoCAD 2013 in Win7. I need the same application to work in AutoCAD 2013, XP- 32-bit.

 

I am using Interopp.dll and Interop.Common.dll that I know are specific for each 64-bit vs. 32-bit. So I changed thoses references and recompiled.

 

In the XP version, I get no errors when I load the .DLL, however all I get when I execute the command is a tab along the bottom, no form pop's up.

 

No idea where to look to resolve this, any help would be very appreciated.

 

cj

AutoCAD's ObjectARX document states that one should not use System.Windows.Forms.Form.Show()/ShowDialog() to open a form/dialogbox in AutoCAD. Instead, use Application.ShowModalDialog()/ShowModelessDialog().

 

It says that using Form.Show()/Showmodal() would lead AutoCAD to behave unexpectedly. This is what you are running into. The form (dialog box) is actually open, but somehow is hidden behind AutoCAD's main window.

 

If you click the taskbar icon for the form, it may be brought to front. Luckily, you did not set "ShowInTaskBar" property to false (you should, if you follow AutoCAD's UI style). This is because of your use of Form.ShowDialog(), hence the unexpected behaviour of AutoCAD.

 

You may say: but it works with Acad2013 + Win 7. Well, that was why Autodesk call it "unexpected" - it may work here and may not work there. The only sure thing is it works if you use Application.ShowModalDialog()/ShowModelessDialog().

Distinguished Mentor
582 Posts
91 Kudos
Registered: ‎04-11-2010
Post 2 of 5

Re: No form visible in 32-bit compiled .DLL

04-10-2013 04:54 PM in reply to: cjacobi

Hi,

 

If You are not seeing the form, where are the  "tab along the bottom" displayed?, can you post a screen grab of the issue, and the code for calling the form to display?

 

Gaston Nunez

Valued Contributor
55 Posts
0 Kudos
Registered: ‎11-12-2012
Post 3 of 5

Re: No form visible in 32-bit compiled .DLL

04-11-2013 10:52 AM in reply to: gasty1001

Here is the code to open the form...

 

      

SelectCaseApplication.ShowModalDialog(Myform)

               

Case System.Windows.Forms.DialogResult.OK

                   

Dim noblocklist AsString = ""

                   

Dim error_coord_cnt AsInteger = 0

                   

Dim blockmismatch AsString = ""

                   

Dim excelatt_ELEV AsString = ""

                   

Dim excelatt_CHEM AsString = ""

 

...............

 

See the attachment for what I get, just another tab after the AutoCAD one along the bottom of the screen.

 

Have tried on another XP 32-bit machine and the form comes in fine. Thinking it's a DLL missing???

*Expert Elite*
1,088 Posts
217 Kudos
Registered: ‎04-27-2009
Post 4 of 5

Re: No form visible in 32-bit compiled .DLL

04-11-2013 02:12 PM in reply to: cjacobi

AutoCAD's ObjectARX document states that one should not use System.Windows.Forms.Form.Show()/ShowDialog() to open a form/dialogbox in AutoCAD. Instead, use Application.ShowModalDialog()/ShowModelessDialog().

 

It says that using Form.Show()/Showmodal() would lead AutoCAD to behave unexpectedly. This is what you are running into. The form (dialog box) is actually open, but somehow is hidden behind AutoCAD's main window.

 

If you click the taskbar icon for the form, it may be brought to front. Luckily, you did not set "ShowInTaskBar" property to false (you should, if you follow AutoCAD's UI style). This is because of your use of Form.ShowDialog(), hence the unexpected behaviour of AutoCAD.

 

You may say: but it works with Acad2013 + Win 7. Well, that was why Autodesk call it "unexpected" - it may work here and may not work there. The only sure thing is it works if you use Application.ShowModalDialog()/ShowModelessDialog().

Valued Contributor
55 Posts
0 Kudos
Registered: ‎11-12-2012
Post 5 of 5

Re: No form visible in 32-bit compiled .DLL

04-12-2013 12:46 PM in reply to: norman.yuan

Think that did the trick....thanks for your help!!!

 

cj

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!