Controling AutoCAD document from the VB MDI form menu

Controling AutoCAD document from the VB MDI form menu

Anonymous
Not applicable
483 Views
5 Replies
Message 1 of 6

Controling AutoCAD document from the VB MDI form menu

Anonymous
Not applicable
Please share your valuable time and knowledge....
Is there any way to open "ACAD document" as child form in VB MDI form? Actually I wanted to control AutoCAD document from the VB MDI form menu.
0 Likes
484 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
What kind of "control"?

--
----
Ed
----
0 Likes
Message 3 of 6

Anonymous
Not applicable
Hi Ed Jobe
Just like our forms in vb which is under MDI means like child form.
In short I wanted to open whole AutoCAD as a form of my application which will be child form of my MDI form.
0 Likes
Message 4 of 6

Anonymous
Not applicable
> I wanted to open whole AutoCAD as a form of my application which will be child form of my MDI form.

From the Department of Stupid Programming Tricks:

[MDIForm1 code]

Option Explicit

Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long

Private m_hAcadParent As Long
Private m_acad As AutoCAD.AcadApplication

Private Sub MDIForm_Load()
Set m_acad = CreateObject("AutoCAD.Application")
m_hAcadParent = SetParent(m_acad.hWnd, Me.hWnd)
m_acad.Visible = True
End Sub

Private Sub MDIForm_Unload(Cancel As Integer)
m_acad.Visible = False
SetParent m_acad.hWnd, m_hAcadParent
m_acad.Quit
End Sub
0 Likes
Message 5 of 6

Anonymous
Not applicable
hi fantum
LOT LOT LOT LOT LOT LOT's of thanks u solved my whole problem
Thank u very much
0 Likes
Message 6 of 6

Anonymous
Not applicable
> u solved my whole problem

What I did was help you put an elephant in a closet. I don't expect anything good to come of it and you probably shouldn't either.
0 Likes