Making C# User Controls Visible to Visual Basic 6.0 Applications

J

john

I searched http://www.sellsbrothers.com. and could not find anything
about this subject.

How do I make C# User Controls Visible to Visual Basic 6.0
Applications?

Thanks,

John


************************************
From: Nicholas Paldino [.NET/C# MVP]
([email protected])
Subject: Re: Making C# User Controls Visible to Visual Basic 6.0
Applications


View this article only
Newsgroups: microsoft.public.dotnet.languages.csharp
Date: 2003-08-08 06:08:34 PST


Miquel,

.NET doesn't officially support exporting controls as ActiveX
controls.
It was in one of the early betas for the original release, but was
then
dropped. However, Chris Sells (I believe) found a way to do it with
some
settings and interface implementations. You can try checking out his
website http://www.sellsbrothers.com.

Hope this helps.
 
B

Bob Powell [MVP]

You don't

--
Bob Powell [MVP]
Visual C#, System.Drawing

All you ever wanted to know about ListView custom drawing is in Well Formed.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*

The GDI+ FAQ: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://royo.is-a-geek.com/siteFeeder/GetFeed.aspx?FeedId=41

*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*





john said:
I searched http://www.sellsbrothers.com. and could not find anything
about this subject.

How do I make C# User Controls Visible to Visual Basic 6.0
Applications?

Thanks,

John


************************************
From: Nicholas Paldino [.NET/C# MVP]
([email protected])
Subject: Re: Making C# User Controls Visible to Visual Basic 6.0
Applications


View this article only
Newsgroups: microsoft.public.dotnet.languages.csharp
Date: 2003-08-08 06:08:34 PST


Miquel,

.NET doesn't officially support exporting controls as ActiveX
controls.
It was in one of the early betas for the original release, but was
then
dropped. However, Chris Sells (I believe) found a way to do it with
some
settings and interface implementations. You can try checking out his
website http://www.sellsbrothers.com.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Miquel Taberner said:
Hi there,

I want to know if there's any way to put an user control developed in
C# into the toolbox of our old friend Visual Basic 6.0. The reason for
that is to start to migrate the code to C# step by step and keep using
legacy interfaces. I've just achieved to include the library as a DLL
but I'm not able to visualize the component into the toolbox.

I've added the class in runtime to a form, and I can see the control,
but still I don't have access to the methods or properties. On the
other side, I've created an object with the name of the class and I've
been able to access all the proerties and methods ( and even debugging
with .NET ) but I hadn't been able to show it in the form.

Any help, Any Hint?

Thanks in Advance.

Miquel Taberner.
 
J

john

OK,OK:)))
Now I can see my c# User Control in the ActiveX Control Test Container
( of the old Visual Studio 6).
I can test it till I drop, but when I try it from VB 6 ( ouch) - I
cannot see it on my beautiful form .

I'll do more homework, just tell me where to start.


Thanks,
John


Bob Powell said:
You don't

--
Bob Powell [MVP]
Visual C#, System.Drawing

All you ever wanted to know about ListView custom drawing is in Well Formed.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*

The GDI+ FAQ: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://royo.is-a-geek.com/siteFeeder/GetFeed.aspx?FeedId=41

*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*





john said:
I searched http://www.sellsbrothers.com. and could not find anything
about this subject.

How do I make C# User Controls Visible to Visual Basic 6.0
Applications?

Thanks,

John


************************************
From: Nicholas Paldino [.NET/C# MVP]
([email protected])
Subject: Re: Making C# User Controls Visible to Visual Basic 6.0
Applications


View this article only
Newsgroups: microsoft.public.dotnet.languages.csharp
Date: 2003-08-08 06:08:34 PST


Miquel,

.NET doesn't officially support exporting controls as ActiveX
controls.
It was in one of the early betas for the original release, but was
then
dropped. However, Chris Sells (I believe) found a way to do it with
some
settings and interface implementations. You can try checking out his
website http://www.sellsbrothers.com.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Miquel Taberner said:
Hi there,

I want to know if there's any way to put an user control developed in
C# into the toolbox of our old friend Visual Basic 6.0. The reason for
that is to start to migrate the code to C# step by step and keep using
legacy interfaces. I've just achieved to include the library as a DLL
but I'm not able to visualize the component into the toolbox.

I've added the class in runtime to a form, and I can see the control,
but still I don't have access to the methods or properties. On the
other side, I've created an object with the name of the class and I've
been able to access all the proerties and methods ( and even debugging
with .NET ) but I hadn't been able to show it in the form.

Any help, Any Hint?

Thanks in Advance.

Miquel Taberner.
 
C

clintonG

You have to convert the User Control to a Custom Control. You can
then reuse the Custom Control in legacy COM applications. Don't
ask me the details as I wouldn't know but have learned for a fact that
User Controls do not compile to .dll or .exe where the Custom Control
does and was created especially for circumstances such as those you
are working with.

You'll get some insight by searching using terms such as PInvoke,
"Runtime Callable Wrapper" and "COM Interop" where doing so
will result in documentation regarding how legacy COM is used within
the Framework. Approaching your objective through the back door
should lead to discussion of the converse circumstances which you are
attempting to learn to achieve.

--
<%= Clinton Gallagher
A/E/C Consulting, Web Design, e-Commerce Software Development
Wauwatosa, Milwaukee County, Wisconsin USA
NET (e-mail address removed)
URL http://www.metromilwaukee.com/clintongallagher/




john said:
OK,OK:)))
Now I can see my c# User Control in the ActiveX Control Test Container
( of the old Visual Studio 6).
I can test it till I drop, but when I try it from VB 6 ( ouch) - I
cannot see it on my beautiful form .

I'll do more homework, just tell me where to start.


Thanks,
John


"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
You don't

--
Bob Powell [MVP]
Visual C#, System.Drawing

All you ever wanted to know about ListView custom drawing is in Well Formed.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*

The GDI+ FAQ: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://royo.is-a-geek.com/siteFeeder/GetFeed.aspx?FeedId=41

*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*





john said:
I searched http://www.sellsbrothers.com. and could not find anything
about this subject.

How do I make C# User Controls Visible to Visual Basic 6.0
Applications?

Thanks,

John


************************************
From: Nicholas Paldino [.NET/C# MVP]
([email protected])
Subject: Re: Making C# User Controls Visible to Visual Basic 6.0
Applications


View this article only
Newsgroups: microsoft.public.dotnet.languages.csharp
Date: 2003-08-08 06:08:34 PST


Miquel,

.NET doesn't officially support exporting controls as ActiveX
controls.
It was in one of the early betas for the original release, but was
then
dropped. However, Chris Sells (I believe) found a way to do it with
some
settings and interface implementations. You can try checking out his
website http://www.sellsbrothers.com.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi there,

I want to know if there's any way to put an user control developed in
C# into the toolbox of our old friend Visual Basic 6.0. The reason for
that is to start to migrate the code to C# step by step and keep using
legacy interfaces. I've just achieved to include the library as a DLL
but I'm not able to visualize the component into the toolbox.

I've added the class in runtime to a form, and I can see the control,
but still I don't have access to the methods or properties. On the
other side, I've created an object with the name of the class and I've
been able to access all the proerties and methods ( and even debugging
with .NET ) but I hadn't been able to show it in the form.

Any help, Any Hint?

Thanks in Advance.

Miquel Taberner.
 
N

Nicholas Paldino [.NET/C# MVP]

John,

.NET does not support exporting controls as ActiveX controls. There is
a workaround, but it is EXTREMELY unsupported. You can find mroe
information in an article titled "Hosting Windows Forms Controls in COM
Control Containers" located at (watch for line wrap):

http://www.ondotnet.com/pub/a/dotnet/2003/01/20/winformshosting.html

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

john said:
OK,OK:)))
Now I can see my c# User Control in the ActiveX Control Test Container
( of the old Visual Studio 6).
I can test it till I drop, but when I try it from VB 6 ( ouch) - I
cannot see it on my beautiful form .

I'll do more homework, just tell me where to start.


Thanks,
John


"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
You don't

--
Bob Powell [MVP]
Visual C#, System.Drawing

All you ever wanted to know about ListView custom drawing is in Well Formed.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*

The GDI+ FAQ: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://royo.is-a-geek.com/siteFeeder/GetFeed.aspx?FeedId=41

*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*RSS*





john said:
I searched http://www.sellsbrothers.com. and could not find anything
about this subject.

How do I make C# User Controls Visible to Visual Basic 6.0
Applications?

Thanks,

John


************************************
From: Nicholas Paldino [.NET/C# MVP]
([email protected])
Subject: Re: Making C# User Controls Visible to Visual Basic 6.0
Applications


View this article only
Newsgroups: microsoft.public.dotnet.languages.csharp
Date: 2003-08-08 06:08:34 PST


Miquel,

.NET doesn't officially support exporting controls as ActiveX
controls.
It was in one of the early betas for the original release, but was
then
dropped. However, Chris Sells (I believe) found a way to do it with
some
settings and interface implementations. You can try checking out his
website http://www.sellsbrothers.com.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi there,

I want to know if there's any way to put an user control developed in
C# into the toolbox of our old friend Visual Basic 6.0. The reason for
that is to start to migrate the code to C# step by step and keep using
legacy interfaces. I've just achieved to include the library as a DLL
but I'm not able to visualize the component into the toolbox.

I've added the class in runtime to a form, and I can see the control,
but still I don't have access to the methods or properties. On the
other side, I've created an object with the name of the class and I've
been able to access all the proerties and methods ( and even debugging
with .NET ) but I hadn't been able to show it in the form.

Any help, Any Hint?

Thanks in Advance.

Miquel Taberner.
 

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