PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 5.00 average.

Windows Control (OCX?) using .NET placed in VB6 project

 
 
Daniel Wilson
Guest
Posts: n/a
 
      10th Sep 2004
I am replacing an ActiveX OCX that was created in VB6. It is used heavily in
a large VB6 program that I do not have the luxury of upgrading to .NET.

The new control must use a significant amount of code that was written in
C++ .NET for a web service.

In C++ .NET, I have the option of creating an MFC ActiveX Control. That
control loads onto a VB6 form just fine. But when I start including .NET
managed code, I run into compile errors.

I also have the option of creating a Windows Control Library (.NET). But
this doesn't load into the VB6 form, at least in the designer. This link
suggests this approach might work at runtime:
http://p2p.wrox.com/topic.asp?TOPIC_ID=5542

This one sounds like what I want to do is completely impossible.
http://www.dotnet247.com/247referenc...24/122843.aspx

Can my .NET code be used on by VB6 form? Can you point me to some
information on doing so? On writing a wrapper to do so?

Thanks!

dwilson


 
Reply With Quote
 
 
 
 
Daniel Wilson
Guest
Posts: n/a
 
      10th Sep 2004
OK, here are some links for anyone who wants to explore what I'm exploring:
http://www.ondotnet.com/pub/a/dotnet...mshosting.html -- an
unsupported method that sometimes works.
http://www.dotnet247.com/247referenc...55/276599.aspx -- Maybe works,
but munges the name.


"Daniel Wilson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I am replacing an ActiveX OCX that was created in VB6. It is used heavily

in
> a large VB6 program that I do not have the luxury of upgrading to .NET.
>
> The new control must use a significant amount of code that was written in
> C++ .NET for a web service.
>
> In C++ .NET, I have the option of creating an MFC ActiveX Control. That
> control loads onto a VB6 form just fine. But when I start including .NET
> managed code, I run into compile errors.
>
> I also have the option of creating a Windows Control Library (.NET). But
> this doesn't load into the VB6 form, at least in the designer. This link
> suggests this approach might work at runtime:
> http://p2p.wrox.com/topic.asp?TOPIC_ID=5542
>
> This one sounds like what I want to do is completely impossible.
> http://www.dotnet247.com/247referenc...24/122843.aspx
>
> Can my .NET code be used on by VB6 form? Can you point me to some
> information on doing so? On writing a wrapper to do so?
>
> Thanks!
>
> dwilson
>
>



 
Reply With Quote
 
 
 
 
Daniel Wilson
Guest
Posts: n/a
 
      20th Sep 2004
http://www.dotnet247.com/247reference/msgs/4/20375.aspx

Long discussions comes to the conclusion that this was SUPPOSED to be
supported, but was cut out. Maybe we'll get it at some point in the
future????

I'm not the only developer who NEEDS to do this ... directly or through some
workaround. I realize MS thought developers would more often need to put
old controls into new projects, but it really DOES go both ways.

For a week now, I've been instantiating a .NET control at runtime from VB6,
but the lousy thing won't show up on the screen. Its Visible property is
true ... but it can't be seen.

Since image display is what I'm working on here, I tried a BitBlt from the
..NET control's Handle to my VB6 PictureBox's hDC. No error, but no luck.

I AM managing to reach over to the .NET control's Image (that I'm exposing)
with a GetPixel call, then paint pixel-by-pixel in VB6. Stinks, but may
work in my case.

dwilson

"Daniel Wilson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> OK, here are some links for anyone who wants to explore what I'm

exploring:
> http://www.ondotnet.com/pub/a/dotnet...mshosting.html -- an
> unsupported method that sometimes works.
> http://www.dotnet247.com/247referenc...55/276599.aspx -- Maybe works,
> but munges the name.
>
>
> "Daniel Wilson" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > I am replacing an ActiveX OCX that was created in VB6. It is used

heavily
> in
> > a large VB6 program that I do not have the luxury of upgrading to .NET.
> >
> > The new control must use a significant amount of code that was written

in
> > C++ .NET for a web service.
> >
> > In C++ .NET, I have the option of creating an MFC ActiveX Control. That
> > control loads onto a VB6 form just fine. But when I start including

..NET
> > managed code, I run into compile errors.
> >
> > I also have the option of creating a Windows Control Library (.NET). But
> > this doesn't load into the VB6 form, at least in the designer. This link
> > suggests this approach might work at runtime:
> > http://p2p.wrox.com/topic.asp?TOPIC_ID=5542
> >
> > This one sounds like what I want to do is completely impossible.
> > http://www.dotnet247.com/247referenc...24/122843.aspx
> >
> > Can my .NET code be used on by VB6 form? Can you point me to some
> > information on doing so? On writing a wrapper to do so?
> >
> > Thanks!
> >
> > dwilson
> >
> >

>
>



 
Reply With Quote
 
Daniel Wilson
Guest
Posts: n/a
 
      13th Oct 2004
For anybody following this ... or digging it up in the future ...

My control is an image-rendering thing. So I have managed to cheat by
running it invisible with an VB6 wrapper OCX that passes all the parameters
through. When it's time to display the image, my wrapper tells the control
to dump the image to a JPEG, then loads it up itself. The cheat is working
well enough to go into production.

I have some other issues ... right now dealing w/ a
WindowsFormsParkingWindow message that pops up w/ an access violation when
the VB6 form hosting my VB6 wrapper OCX hosting the .NET control closes.
I'll let you know if/when I get a good solution.

dwilson

"Daniel Wilson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> http://www.dotnet247.com/247reference/msgs/4/20375.aspx
>
> Long discussions comes to the conclusion that this was SUPPOSED to be
> supported, but was cut out. Maybe we'll get it at some point in the
> future????
>
> I'm not the only developer who NEEDS to do this ... directly or through

some
> workaround. I realize MS thought developers would more often need to put
> old controls into new projects, but it really DOES go both ways.
>
> For a week now, I've been instantiating a .NET control at runtime from

VB6,
> but the lousy thing won't show up on the screen. Its Visible property is
> true ... but it can't be seen.
>
> Since image display is what I'm working on here, I tried a BitBlt from the
> .NET control's Handle to my VB6 PictureBox's hDC. No error, but no luck.
>
> I AM managing to reach over to the .NET control's Image (that I'm

exposing)
> with a GetPixel call, then paint pixel-by-pixel in VB6. Stinks, but may
> work in my case.
>
> dwilson
>
> "Daniel Wilson" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > OK, here are some links for anyone who wants to explore what I'm

> exploring:
> > http://www.ondotnet.com/pub/a/dotnet...mshosting.html --

an
> > unsupported method that sometimes works.
> > http://www.dotnet247.com/247referenc...55/276599.aspx -- Maybe

works,
> > but munges the name.
> >
> >
> > "Daniel Wilson" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > I am replacing an ActiveX OCX that was created in VB6. It is used

> heavily
> > in
> > > a large VB6 program that I do not have the luxury of upgrading to

..NET.
> > >
> > > The new control must use a significant amount of code that was written

> in
> > > C++ .NET for a web service.
> > >
> > > In C++ .NET, I have the option of creating an MFC ActiveX Control.

That
> > > control loads onto a VB6 form just fine. But when I start including

> .NET
> > > managed code, I run into compile errors.
> > >
> > > I also have the option of creating a Windows Control Library (.NET).

But
> > > this doesn't load into the VB6 form, at least in the designer. This

link
> > > suggests this approach might work at runtime:
> > > http://p2p.wrox.com/topic.asp?TOPIC_ID=5542
> > >
> > > This one sounds like what I want to do is completely impossible.
> > > http://www.dotnet247.com/247referenc...24/122843.aspx
> > >
> > > Can my .NET code be used on by VB6 form? Can you point me to some
> > > information on doing so? On writing a wrapper to do so?
> > >
> > > Thanks!
> > >
> > > dwilson
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading Dynamic User Control Error: "The control must be placed inside a form tag with runat=server" Help Please Second time posting. davidr@sharpesoft.com Microsoft ASP .NET 0 31st Aug 2006 06:26 PM
creating a custom control that extends the DataGrid control and can be placed on the toolbox problem Wiredless Microsoft Dot NET Compact Framework 3 3rd Jun 2005 06:44 AM
Problem with web server control placed on web user control okaminer Microsoft ASP .NET 2 8th Feb 2005 04:34 PM
Re: VB Standard compile project from VB Pro Project conversion of VB6 Herfried K. Wagner Microsoft VB .NET 1 8th Jul 2003 06:26 PM
Re: VB Standard compile project from VB Pro Project conversion of VB6 Armin Zingler Microsoft VB .NET 0 8th Jul 2003 04:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:31 PM.