Hi,
I am working in an eclipse PDE where i need to have a COM dll created in VB.NET to be loaded in my current project.
I already have a VC++ COM dll working but the same is not working with the .NET COM dll.
The working snippet of the VC++ COM dll is below:
OleFrame frame = new OleFrame(parent, SWT.V_SCROLL | SWT.H_SCROLL);
sim = new OleControlSite(frame, SWT.NONE, "SimulatorGUI.SimulatorGUICtrl");
sim.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
sim.doVerb(OLE.OLEIVERB_SHOW);
this.setPartName("Track Layout");
mSimIntf = new OleAutomation(sim);
This works great but when i replace the same with my dll prog id instead it does not work and throes an error saying "Could not create the view: Failed to create Ole Client. result = -2147467262"
My VB.NET is fine and properly exported to COM. See the snippet of the same below for reference:
Imports System
Imports System.Runtime.InteropServices
Namespace SIMIICOMComponent
<Guid("D2964724-F498-4ad3-8089-4B8FFCAAA8B8"), _
InterfaceType(ComInterfaceType.InterfaceIsIDispatch)> _
Public Interface _ISIMCOMClass
<DispId(1)> Function MlFileInput(ByVal FileName As String) As System.Windows.Forms.Form
<DispId(2)> Sub Load()
End Interface
<Guid("776176c4-cec0-4a6a-b3d5-e039a72029e1"), _
ClassInterface(ClassInterfaceType.None), _
ProgId("SIMIICOMComponent.SIMIIComClasss")> Public Class SIMIIComClass
Implements _ISIMCOMClass
Private frm As frmMain
Public SIMIIComClass()
Public Function MlFileInput(ByVal FileName As String) As System.Windows.Forms.Form Implements _ISIMCOMClass.MlFileInput
frm = New frmMain
frm.FileName = FileName
Return frm
End Function
Public Sub Load() Implements _ISIMCOMClass.Load
frm.LoadProgram(frm.FileName, False)
End Sub
End Class
End Namespace
Please help resolve this issue.
Regards,
Ravi