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

creating COM objects

P: n/a
I am creating an aspx application to use our existing COM objects. I
referenced the component correctly and i have it Dimmed correctly. What i
get is "InvalidCastException". Here is the code

Dim cfg as CIBOMConfig.IB_BOMConfig
Dim o as Object
o = CreateObject("CBOMConfig.IB_BOMConfig")
cfg = o ' error happens here.

CIBOMConfig.IB_BOMConfig is not the default interface for this component.
It is one of the implement statements. I can't figure out how to get the
..NET eqivalent of QueryInterface to work. in VB6 the assignment would do
it.

Dan Holmes
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I don't know if it matters but the implements statement in the VB6 component
is from a type library i created. I didn't reference the dll but the tlb.

Dan Holmes

"Dan Holmes" <dh*****@ivsi.com> wrote in message
news:O8**************@TK2MSFTNGP11.phx.gbl...
I am creating an aspx application to use our existing COM objects. I
referenced the component correctly and i have it Dimmed correctly. What i
get is "InvalidCastException". Here is the code

Dim cfg as CIBOMConfig.IB_BOMConfig
Dim o as Object
o = CreateObject("CBOMConfig.IB_BOMConfig")
cfg = o ' error happens here.

CIBOMConfig.IB_BOMConfig is not the default interface for this component.
It is one of the implement statements. I can't figure out how to get the
.NET eqivalent of QueryInterface to work. in VB6 the assignment would do
it.

Dan Holmes

Nov 20 '05 #2

P: n/a
Hi Dan, try this:

Dim cfg As New CIBOMConfig.IB_BOMConfig

and then just use 'cfg' as you would

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

" System.Reflection Master "

==== Converting to 2002 ====
Remove inline declarations
"Dan Holmes" <dh*****@ivsi.com> wrote in message
news:O8**************@TK2MSFTNGP11.phx.gbl...
I am creating an aspx application to use our existing COM objects. I
referenced the component correctly and i have it Dimmed correctly. What i
get is "InvalidCastException". Here is the code

Dim cfg as CIBOMConfig.IB_BOMConfig
Dim o as Object
o = CreateObject("CBOMConfig.IB_BOMConfig")
cfg = o ' error happens here.

CIBOMConfig.IB_BOMConfig is not the default interface for this component.
It is one of the implement statements. I can't figure out how to get the
.NET eqivalent of QueryInterface to work. in VB6 the assignment would do
it.

Dan Holmes

Nov 20 '05 #3

P: n/a
VB won't let me do that. the CIBOMConfig.IB_BOMConfig is underlined green.
Intellisense didn't prompt for that either. It is just an interface though.

Dan Holmes

"Tom Spink" <th**********@ntlworld.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hi Dan, try this:

Dim cfg As New CIBOMConfig.IB_BOMConfig

and then just use 'cfg' as you would

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

" System.Reflection Master "

==== Converting to 2002 ====
Remove inline declarations
"Dan Holmes" <dh*****@ivsi.com> wrote in message
news:O8**************@TK2MSFTNGP11.phx.gbl...
I am creating an aspx application to use our existing COM objects. I
referenced the component correctly and i have it Dimmed correctly. What i get is "InvalidCastException". Here is the code

Dim cfg as CIBOMConfig.IB_BOMConfig
Dim o as Object
o = CreateObject("CBOMConfig.IB_BOMConfig")
cfg = o ' error happens here.

CIBOMConfig.IB_BOMConfig is not the default interface for this component. It is one of the implement statements. I can't figure out how to get the .NET eqivalent of QueryInterface to work. in VB6 the assignment would do it.

Dan Holmes


Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.