Hello Techies,
I have a third party OCX (VB 6.0) and I'm using it in a VB .NET 1.0 windows application.
I'm able to install the OCX by copying it to the system32 directory and I noticed that the OCX is readily available as a component even before I could register it using REGSVR32.
I have a VB 6.0 application that uses the third party OCX and it works like a charm.
And I also have VB. NET 1.0 windows application which uses the same OCX but for some strange reasons the OCX fails to work in the .NET environment and it throws an exception on certain workstations in the production. I get this error on 2 out 4workstations. The exception is the following
<ERROR_.NET_1.0>
System.Runtime.InteropServices.COMException (0x800AC352): Exception de HRESULT : 0x800AC352.
at System.Windows.Forms.AxHost.CreateInstance()
at System.Windows.Forms.AxHost.GetOcxCreate()
at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)
at System.Windows.Forms.AxHost.CreateHandle()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.AxHost.EndInit()
at DebugProject.frmEDDAT.InitializeComponent() in C:\clement\slnDebugProd\DebugProject\frmEDDAT.vb:line 67
at DebugProject.frmEDDAT..ctor() in C:\clement\slnDebugProd\DebugProject\frmEDDAT.vb:line 10
at DebugProject.frmMain.btnEDDAT_Click(Object sender, EventArgs e) in C:\clement\slnDebugProd\DebugProject\frmMain.vb:line 134
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
</ ERROR_.NET_1.0>
Similarly I noticed that I'm having troubles in using this OCX in a "User Form" created in MS Word using the Visual Basic Editor. I'm able to add the control to the toolbox of the VBA IDE in MS Word. But when I try adding the control to the "User Form" it crashes word. The exception is the following
<ERROR_VBA>
AppName: winword.exe AppVer: 11.0.8215.0 AppStamp:48000d55
ModName: msvbvm60.dll ModVer: 6.0.97.82 ModStamp:403acfec
fDebug: 0 Offset: 00005453
</ERROR_VBA>
In short the OCX works in VB 6 environment but fails in .NET 1.0 & VBA environment.
Basically I'm looking a solution for the .NET issue and the VBA issue is not a priority.
Any form of help is greatly appreciated.
Thanks & Regards
Clement