index > Visual C# General > Is it possible to use .NET controls to VB6.

Is it possible to use .NET controls to VB6.

Hi,

Please any one tell me is it possible to use .NET controls and libraries [ created by C# ] to VB6. If so can you tell me the way and some useful existing articles regarding this query.

Thanks,




Prabu
Prabu.

Yes it is possible to call .NET assemblies from VB 6.0. You need to create a COM interface to .NET assemblies by using RegAsm and generate a type library file. Refer this MSDN article for a detailed explanation

http://support.microsoft.com/?kbid=817248

HTH

Uday

hedgeu

It's not supported to host Windows Forms controls on VB6 forms.




Mattias, C# MVP
Mattias Sjögren

Hi,

Thanks for the support. Now I am able to use .net libraries to VB6. But I have one more problem. The behaviours like overloading constructors, methods and method return to the object functionalities are can not seems to be work in VB6.




Prabu
Prabu.
Prabu. wrote:

Hi,

Thanks for the support. Now I am able to use .net libraries to VB6. But I have one more problem. The behaviours like overloading constructors, methods and method return to the object functionalities are can not seems to be work in VB6.



Every Com Visable class must have a empty ctor, and make sure you use only basic types as return values or you own types! For example if you want to return an Color, don't return a instance of the Color struct, but return an Integer that contains the colors ARGB.



** Microsoft Community Moderator ** http://born2code.net **
PJ. van de Sande
Prabu. wrote:

Hi,

Please any one tell me is it possible to use .NET controls and libraries [ created by C# ] to VB6. If so can you tell me the way and some useful existing articles regarding this query.

Thanks,



Yes this is
PJ. van de Sande

PJ. van de Sande wrote:

Yes this is
Mattias Sjögren
Mattias Sjögren wrote:
ActiveX control containers that support .NET controls

http://support.microsoft.com/?kbid=311334

Indeed Mattias, i thought you were saying that it wasn't posible... my bad!




** Microsoft Community Moderator ** http://born2code.net **
PJ. van de Sande
reply 8

You can use google to search for other answers

 

More Articles

• Data set part 2
• Excel Automation Addin Problem
• TabControl MouseHover!
• 2d arrays to method's
• Visual Studio Academic Editions
• String to database
• Unlimited Controls
• Resize Window and move controls
• Getting the panel's text of a scrollbar in another application
• c# and network
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Windows Service that watches the keyboard
• How do you intercept the Minimize button?
• Just Learning how-to-use C# - Please can
• Hexadecimal Question
• byte[] writing and byte[] reading
• how to check if remote user has administ
• Add reference at run time
• DataGrid RowSelection
• How to execute exe file from my built ex
• rectangle question(c#)
• Find types of a template class at run time
• e-mail link
• Encode
• how can i format 5 to May?
• Capture Data From Modem

Hot Articles

• Need code for program (not the whole code)
• How to make toolbar
• Capture Data From Modem
• web user control
• C# get the return parameter from storage
• OOP Data Access Question
• Reflection Related query
• RichTextBox rtf to HTML
• How to convert arabic text to english sp
• How to change LinearGradientBrush with l
• GDI+ Question: ImageAttributes.SetGamma
• Is it possible to configure the "AS
• Synchronize between domain controllers
• To Load SHDOCLC.dll and customize contex
• [Help]problem with an MDI Application us

Recommend Articles

• AccessViolationException thrown now and
• How to Create CHM File Using C#?
• Spell Checker using word.
• connection string question
• Screenshot ...
• .NET cryptography
• cast
• C# Checking whether a cookie exists or not
• set desktop background with c#
• Windows Service
• FlowLayOutPanel and threads
• how do i change the font color of a Stri
• Where it get stored?
• Parse vs Convert
• How to make the Leave event fire on a co