Friday, April 24, 2009

ShowModalDialog API changes in AutoCAD 2010

I got this error in some .NET code I updated to get running for AutoCAD 2010.

Error    1    Reference required to assembly 'PresentationCore, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35' containing the implemented interface 'System.Windows.Interop.IWin32Window'. Add one to your project.    D:\VB.NET\MainProject\Mainclass.vb    15    74    MainProject

I found that I needed to change this code showing a modal dialog box.

Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog(Application.MainWindow, DialogObj)

to look like this as well as adding the PresentationCore reference.

Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog(Application.MainWindow.Handle, DialogObj, False)

No comments:

Post a Comment

Subscribe to the comments feed

Some of the latest blog posts

Subscribe to RSS headline updates from:
Powered by FeedBurner

Contact Us | About JTB World | Subscribe to this blog
JTB World's website | Website General Terms of Use | Privacy Policy
^ Top of page

© 2004- JTB World. All rights reserved.