473,792 Members | 3,042 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Create an ActiveX Control in .NET and use it under VB6

Hello

Is it Possible to build an ActiveX Control with NET ?

I want to take a NET UserControl and use it with VB6.

I found a solution how to embbed a NET UserControl into
a WebPage (Like it was possible with ActiveX Control)

http://www.vbdotnetheaven.com/Code/Jun2003/2067.asp

Maybe that is the halve way.

Any Idea ?


Nov 20 '05 #1
4 1443
* "Captain Chaos" <no****@nospam. com> scripsit:
Is it Possible to build an ActiveX Control with NET ?
No.
I want to take a NET UserControl and use it with VB6.

I found a solution how to embbed a NET UserControl into
a WebPage (Like it was possible with ActiveX Control)

http://www.vbdotnetheaven.com/Code/Jun2003/2067.asp

Maybe that is the halve way.


"Forget it."

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
That's not the answer I want to hear :-)

I am 1000% sure there may be a proper solution
but I only know a very dirty one that I don't like......

For example I could create a NET Window, put the NET Control in it.
The create a COM Interface.
Then Create a VB6 ActiveX Control an call the COM Interface.
Then open the Window, getting the Windows Handle of the Control
and place the Control via Windows API (setParent) in the VB6 ActiveX
Control.

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> schrieb im Newsbeitrag
news:uq******** ******@TK2MSFTN GP12.phx.gbl...
* "Captain Chaos" <no****@nospam. com> scripsit:
Is it Possible to build an ActiveX Control with NET ?


No.
I want to take a NET UserControl and use it with VB6.

I found a solution how to embbed a NET UserControl into
a WebPage (Like it was possible with ActiveX Control)

http://www.vbdotnetheaven.com/Code/Jun2003/2067.asp

Maybe that is the halve way.


"Forget it."

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #3
Ok, i found some kind of solution myself:

First Create a COM Class with DOT NET.
Menu "Project" - "AddNew Item" - Com Class.

But the Code from there into your UserControl

It look something like this the:
<ComClass(UserC ontrol1.ClassId , UserControl1.In terfaceId,
UserControl1.Ev entsId)> _
Public Class UserControl1
Inherits System.Windows. Forms.UserContr ol
#Region "COM GUIDs"
' These GUIDs provide the COM identity for this class
' and its COM interfaces. If you change them, existing
' clients will no longer be able to access the class.
Public Const ClassId As String = "4E194D65-C09C-4378-B47F-CAAF521EB8EC"
Public Const InterfaceId As String =
"F9913483-3444-4989-A4D1-F1D4D23955BA"
Public Const EventsId As String = "F05903BF-31A7-47F6-AF5F-67C230D1F172"
#End Region

Windows Form Designer generated code

Public Sub Test()

End Sub

End Class

If you compile the whole thing you there is a *.TLB File created.

Now start VB6:

Make a reference to the TLB File.

Then in the VB 6 User Control you can load your DOT NET Control Dynamicly:

Dim vlob_UserCtrl As Object

Set vlob_UserCtrl = Controls.Add("C lassLibrary5.Us erControl1", "HeadCtrl")
vlob_UserCtrl.L eft = 0
vlob_UserCtrl.T op = 0
vlob_UserCtrl.Z Order 0
vlob_UserCtrl.V isible = True
ClassLibrary5.U serControl1 = Namespace and Controlname of the DOT Net
Control

"Captain Chaos" <no****@nospam. com> schrieb im Newsbeitrag
news:bt******** *****@news.t-online.com...
Hello

Is it Possible to build an ActiveX Control with NET ?

I want to take a NET UserControl and use it with VB6.

I found a solution how to embbed a NET UserControl into
a WebPage (Like it was possible with ActiveX Control)

http://www.vbdotnetheaven.com/Code/Jun2003/2067.asp

Maybe that is the halve way.

Any Idea ?

Nov 20 '05 #4

In Addition:

To Handle Events and Set/Get Properties use Code like this:
Dim vlob_UserCtrl As Object
Dim WithEvents vlob_UserCtrl2 As ClassLibrary5.U serControl1

Private Sub Command1_Click( )

Set vlob_UserCtrl = Controls.Add("C lassLibrary5.Us erControl1", "HeadCtrl")
vlob_UserCtrl.L eft = 0
vlob_UserCtrl.T op = 0
vlob_UserCtrl.H eight = 100
vlob_UserCtrl.Z Order 0
vlob_UserCtrl.V isible = True

Set vlob_UserCtrl2 = vlob_UserCtrl.o bject

'With vlob_UserCtrl2 you can now handle the Events and set/Get
Properties/Call Methodes aso.

End Sub
"Captain Chaos" <no****@nospam. com> schrieb im Newsbeitrag
news:bt******** *****@news.t-online.com...
Hello

Is it Possible to build an ActiveX Control with NET ?

I want to take a NET UserControl and use it with VB6.

I found a solution how to embbed a NET UserControl into
a WebPage (Like it was possible with ActiveX Control)

http://www.vbdotnetheaven.com/Code/Jun2003/2067.asp

Maybe that is the halve way.

Any Idea ?

Nov 20 '05 #5

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

Similar topics

10
3893
by: Andrew Chalk | last post by:
I have an ASP 3.0 page that contains an ActiveX control that I wrote in VC++ v6.0. Under Visual Interdev I can debug the ASP code just fine. However, when I get to an ASP line that references my ActiveX control the debugger does not go inside my C++ code allowing me to debug the ActiveX control. If I load the ActiveX control project from VC++ with Internet Explorer as the debug executable I have the same problem. Break points in the ActiveX...
6
3692
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 Requirement: To create an ActiveX control that could be include in a web Page. This control has a DataGrid on it. Iam unable to do so in MFC ActiveX projects. Im using VS 6.0.
4
2436
by: Mr Seth T | last post by:
Hey, I have spent several days trying to find out how to do something, and i don't know if I am blind or what, but I can not find it. I am developing a web app and I need it to run an activex control. I have developed the control and it runs great on my development system (VS2005, C#, IE6, Win2000Pro, output is a DLL) because as far as I can tell, the IDE registers the DLL. The problem is packaging it so it registers itself on any...
1
2272
by: JUN | last post by:
Hi all, I use c# to create ActiveX control, and works under IE browser. Now, i add a "Save" procedure for this ActiveX,but in Client calling ,it not works. the save procedure: public Boolean Save(String fileName)
0
9670
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9518
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10430
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10211
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10000
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9033
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.