473,395 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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
Jul 21 '05 #1
3 2091
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" <d.******@embtrak.com> wrote in message
news:u5**************@TK2MSFTNGP14.phx.gbl...
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

Jul 21 '05 #2
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" <d.******@embtrak.com> wrote in message
news:ei*************@TK2MSFTNGP11.phx.gbl...
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" <d.******@embtrak.com> wrote in message
news:u5**************@TK2MSFTNGP14.phx.gbl...
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


Jul 21 '05 #3
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" <d.******@embtrak.com> wrote in message
news:ON*************@TK2MSFTNGP10.phx.gbl...
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" <d.******@embtrak.com> wrote in message
news:ei*************@TK2MSFTNGP11.phx.gbl...
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" <d.******@embtrak.com> wrote in message
news:u5**************@TK2MSFTNGP14.phx.gbl...
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



Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: bebelino | last post by:
Hello, The following is up to now not very clearly to me. What ocxfiles to use in A2000? For example: The listview. Now I use the one given in comctl32.ocx (Microsoft windows common controls 5.0...
4
by: (Pete Cresswell) | last post by:
I'm getting nodes into the thing, but when the dust settles, only the root-level nodes are visible. I know they're there because .Nodes.Count gives the right number.\ But I don't really...
3
by: John | last post by:
Hi How can I transfer across the tree control to client? Is there a dll which I can just copy and register using regsvr32? Thanks Regards
7
by: Will | last post by:
I'm working on a C# Windows Service that needs to monitor serial port communication. Because the .Net framework does not include support for serial communications, I've decided to use the...
5
by: andy.g.ward | last post by:
I keep getting this when trying to create an MFC activex control in a c# windows service - anyone got any ideas what the missing module could be??? Exception thrown :...
6
by: Vinay | last post by:
Hi all, Can we create an ActiveX (.OCX) control in ATL project type? Is project type for creation of .OCX file can only be ActiveX MFC type? If yes, Could you suggest me some Links? My...
13
by: Lee Newson | last post by:
Hi, I have just written my first application using VB.NET. The app works fine when i am running it within .NET for debugging purposes, however when i try to run the app from the .exe file that...
3
by: Daniel Wilson | last post by:
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...
0
by: thescriptuser | last post by:
Hi, i create an ocx control in vb.6, it's working well but having some problems. when i create ActiveXObject("Control.UserControl1") through javascript of my control in .aspx page the error occurs...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.