"Catastrophic failure" / "Catastrophic error" accessing ActiveX Object

J

jdanoz

Hello,

i have a vb.net project with a reference to an ActiveX object (ocx).
If i try to use the ocx from vb6 project (adding the reference) it
works ok (using CreateObject).

In vb.net,

the CreateObject works ok, the object gets initialized...

but when i try to run an object method or change an object property
vb.net raises an InteropServices.COMException... "Catastrophic Error /
failure"...

The app type is console.

If i create a windows forms application and i add the ocx reference by
adding this one to the toolbar (personalize toolbar components)... it
runs ok using the name of the object dropped to the windows form.

But i can't use CreateObject for initialize the ocx object... and i
need to do this...

Any sugestions will be appreciated...

Thanks in advance,

Jorge.
 
M

m.posseth

late binding in VB.Net requires some extra coding as in VB6 ( 2 lines extra
to be exact :)

i do this wich works fine in my situation ( late binding to an VB6 Activex
executable )

Imports System.Reflection

Private HBSObject As Object
in my form load

Dim HBSCOM As Type

'Get the object

HBSCOM = Type.GetTypeFromProgID("Hbase.clsHbase")

'Create instance of HBSCOM

HBSObject = Activator.CreateInstance(HBSCOM)

in my cleanup routine

System.Runtime.InteropServices.Marshal.ReleaseComObject(HBSObject)

HBSObject = Nothing

hth



let us now if this did the trick



Regards

Michel Posseth [MCP]
 
J

jdanoz

Hi Michel,

i tested your code but i get the same error "Catastrophic failure"....


Thanks,

Jorge.


m.posseth ha escrito:
late binding in VB.Net requires some extra coding as in VB6 ( 2 lines extra
to be exact :)

i do this wich works fine in my situation ( late binding to an VB6 Activex
executable )

Imports System.Reflection

Private HBSObject As Object
in my form load

Dim HBSCOM As Type

'Get the object

HBSCOM = Type.GetTypeFromProgID("Hbase.clsHbase")

'Create instance of HBSCOM

HBSObject = Activator.CreateInstance(HBSCOM)

in my cleanup routine

System.Runtime.InteropServices.Marshal.ReleaseComObject(HBSObject)

HBSObject = Nothing

hth



let us now if this did the trick



Regards

Michel Posseth [MCP]










jdanoz said:
Hello,

i have a vb.net project with a reference to an ActiveX object (ocx).
If i try to use the ocx from vb6 project (adding the reference) it
works ok (using CreateObject).

In vb.net,

the CreateObject works ok, the object gets initialized...

but when i try to run an object method or change an object property
vb.net raises an InteropServices.COMException... "Catastrophic Error /
failure"...

The app type is console.

If i create a windows forms application and i add the ocx reference by
adding this one to the toolbar (personalize toolbar components)... it
runs ok using the name of the object dropped to the windows form.

But i can't use CreateObject for initialize the ocx object... and i
need to do this...

Any sugestions will be appreciated...

Thanks in advance,

Jorge.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top