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

.NET/COM Interop Issue

P: n/a
Hi All,

I am having a problem getting a .NET control library to "play nice" with VB6.

This particular control wraps a number of other .NET controls in the same
project. It has a number of properties and methods (but no events). I am
using both the ProgIdAttribute and a GuidAttribute, declared before the
class. I also have enabled the "Register for COM Interop" option in the
Build properties.

It compiles correctly, and appears in the registry with the ProgID and Guid
(CLSID) that I specified.

If I try to use late binding to add it to a VB6 application, I always get a
' Runtime error 336: Component not correctly registered'.

I created another, much simpler control (no public properties or methods,
and not wrapping other controls), and specified the ProgIdAttribute. This
one late-binds with no errors, and is interactive (I have a button that
changes the color of a label).

Any ideas?

Thanks,
pagates
Jan 3 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
pagates,

By control, do you mean a visual control (and not just a class)? If
that is the case, you can't do this. .NET does not support exporting
ActiveX controls for use in automation.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"pagates" <pa*****@discussions.microsoft.com> wrote in message
news:FA**********************************@microsof t.com...
Hi All,

I am having a problem getting a .NET control library to "play nice" with
VB6.

This particular control wraps a number of other .NET controls in the same
project. It has a number of properties and methods (but no events). I am
using both the ProgIdAttribute and a GuidAttribute, declared before the
class. I also have enabled the "Register for COM Interop" option in the
Build properties.

It compiles correctly, and appears in the registry with the ProgID and
Guid
(CLSID) that I specified.

If I try to use late binding to add it to a VB6 application, I always get
a
' Runtime error 336: Component not correctly registered'.

I created another, much simpler control (no public properties or methods,
and not wrapping other controls), and specified the ProgIdAttribute. This
one late-binds with no errors, and is interactive (I have a button that
changes the color of a label).

Any ideas?

Thanks,
pagates

Jan 4 '06 #2

P: n/a
If your component is not a visual control, you can find step-by-step
instructions for configuring a .NET component to be accessed via COM
Interop here...

http://j-integra.intrinsyc.com/suppo...?article=78813

The article talks about accessing .NET components from Java using
J-Integra, but the setup on the .NET side is the same no matter what
COM Interop client you are using.

Shane Sauer
J-Integra Interoperability Solutions
http://j-integra.intrinsyc.com/
high performance interop middleware for java, corba, com & .net

Jan 4 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.