By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,903 Members | 2,036 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,903 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.

Nov 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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.ReleaseComO bject(HBSObject)

HBSObject = Nothing

hth

let us now if this did the trick

Regards

Michel Posseth [MCP]




"jdanoz" <jo*********@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
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.

Nov 24 '05 #2

P: n/a

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.ReleaseComO bject(HBSObject)

HBSObject = Nothing

hth

let us now if this did the trick

Regards

Michel Posseth [MCP]




"jdanoz" <jo*********@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
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.


Nov 25 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.