It helps to understand how inheritance works
in a true OOP language.
Your frmPDFFileDia class is derived from the
System.Windows.Forms.Form class, so you do
not need to expose a property of that type on
the form. You should be able to pass 'Me' as
the Form parameter (or 'Me As Form') to the
ShowModalDialog() method and your form
should appear.
There is no need to use SetWindowLong to set
the owner window if you call ShowModalDialog,
because the latter does that for you.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com
wrote in message news:5025641@discussion.autodesk.com...
I am experiencing some "Random" issues related to showing a form in a project of mine.
I started out using the "ShowDialog" method of the form. This method proved to work well while debugging and initial testing. When my custom application was installed on a larger scale, about 70 percent of the installs would not show the dialog.
Here is something strange : on those installs, the form was not visible, but some of the "buttons" where available (I was able to activate controls via an invisible region of the AutoCAD screen)
After some research, I modified the code to use the "ShowDialog" method of the AutoCAD application. Here is methods that I used
Dim oPDFdialog As New frmPDFFileDia(Me, myDrawingFileName)
Dim oPDFDiaResult As System.Windows.Forms.DialogResult
oPDFDiaResult = Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog(oPDFdialog.oForm)
....
I added this property to my form
Friend ReadOnly Property oForm() As System.Windows.Forms.Form
Get
oForm = CType(Me, System.Windows.Forms.Form)
End Get
End Property
I am reasonably sure that the form is not "behind" the AutoCAD Applications form. I can execute a "Ctrl-Tab" and "Activate". When this is done, I see nothing.
Do I need to do the following ?
You might try using SetWindowLong() from user32.dll with its second
parameter set to GWL_HWNDPARENT (-8) to tell your form that acad is its
parent.
If so, does anyone have an example?
Does anyone have any clues?
If I execute methods on the form that change Z-Order or visibility, does that override or cause problems with the showdialog method of
Autodesk.AutoCAD.ApplicationServices.Application
Any help would be appreciated.