Help on GetFeatureMgrViewHWndx64 Dested (VB.Net)

Hallo,

I tested the method GetFeatureMgrViewHWndx64 but I have some problems.

For starters I built a Form where I entered a Panel, the code insert the Feature Manager

us Child in the Panel.

The first problem is that after two or three selections SolidWorks crash, and don't understand the cause.

The second problem is that once closed the Form I remains open a double process of SolidWorks.

I would have also a question to ask, and that is if I can destroy the Feature Manager in the Form.

Have you a nice day

Roberto

This is my code:

SolidWorks.Interop.sldworks


SolidWorks.Interop.swconst


SolidWorks.Interop.swcommands


System.Runtime.InteropServices



Class Form1


Dim swApp As SldWorks


Dim swModel As ModelDoc2


Dim swModViewMgr As ModelViewManager


Dim swFeatMng As FeatureManager


Public Declare Function SetParent Lib "user32" Alias "SetParent" (ByVal hWndChild As Integer, ByVal hWndNewParent As Integer) As Integer


Private Sub ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem1.Click

"SldWorks.Application")

Dim value As System.Int64


Me.Panel1.Handle)

End Sub


Private Sub Form1_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed

Nothing


Marshal.ReleaseComObject(swApp)

Nothing


GC.Collect()

GC.WaitForPendingFinalizers()

GC.Collect()

End Sub


Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing

Nothing


Marshal.ReleaseComObject(swApp)

Nothing


GC.Collect()

GC.WaitForPendingFinalizers()

GC.Collect()

End Sub


Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Class

SolidworksApi macros