Click here to Skip to main content
Click here to Skip to main content

VB6 - C# Interop Form Toolkit

By , 2 Oct 2006
 
Sample Image - newproject.gif

Introduction

After a long period of talking and expectation Interop Form Toolkit is finally released. I blogged about it few days ago here. If you have an existing VB6 application and are considering options to combine it with new .NET module, you definitely need to check it out.

After couple of hours playing with Interop Form Toolkit, one thing I could not understand is "why it supports VB.NET only?" So I decided to fix this injustice.

Two things should be replaced to make the toolkit work perfectly well with C#: Project template and Add-In for Wrapper objects creation. First of all, I created a new C# project template ("VB6 Interop Form Library C#") and a new item template ("C# Interop Form"). Now you will be able to create a new C# project from this template and add new forms with all needed references and attributes. The original Add-In does not bother even to check in which language the current project is written. It assumes that the only possible choice is VB.NET. Add-In creates a wrapper object and deals with public constructors, properties, methods and events. It will add to wrapper only public members marked with one of Interop Toolkit attributes (InteropFormProperty for example). New Add-In can replace the existing one. It can generate wrappers both in C# and VB.NET, based on project language. If you will invoke it in mixed VB.NET/C# solution, for each, project wrappers will be created in the correct language.

Notes

  • Other .NET languages except VB.NET and C# are still ignored.
  • I can only take credit mostly for translation work. Creators of the original Toolkit deserve a lot of thanks.
  • It is unsupported and definitely not a bullet proof tool. Please let me know about problems or feel free to fix the attached code.

Installation

I apologize for not creating the setup for this, but installation is very easy. First of all, you will need to download and install Interop Form Toolkit. Then, you need to copy template zip files into template directories (usually project template will go into ...\My Documents\Visual Studio 2005\Templates\ProjectTemplates\Visual C#\Windows, and item template into ...\My Documents\Visual Studio 2005\Templates\ItemTemplates). And the last one: copy add-in files into Visual Studio 2005 Add-Ins directory (...\My Documents\Visual Studio 2005\Addins).

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Leon Langleyben
Web Developer
Israel Israel
Member
Leon works as Chief Architect at SRL Group. He leads architectural design and development of various enterprise level projects.
You can meet him on user groups, conferences and forums dedicated to Architecture, ASP.NET, Team System etc. or join him for the next white water rafting adventure

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionCommercial LicensememberDupron2 Apr '13 - 1:29 
GeneralMy vote of 5membermanoj kumar choubey14 Mar '12 - 19:13 
SuggestionSolved: Problems with Visual Studio 2010, AddIn not loaded or/and Wrapper still in VB.Netmemberarkimboldo2 Aug '11 - 2:19 
GeneralProblems with Visual Studio 2008 and Interop Forms ToolKit 2.1membergcantarini13 Jul '10 - 3:52 
QuestionHow to attach c# code as VB6 controlmemberajovanov7 Jul '10 - 6:33 
GeneralFYI - recompile the source for VS2010membermmacneill12310 Jun '10 - 3:46 
GeneralProblem creating interop form using VS2008membertrpugh29 Aug '09 - 8:27 
QuestionDoes it work on vs.net 2008?memberdevnet2478 May '09 - 5:26 
AnswerRe: Does it work on vs.net 2008?memberEddy Vluggen21 Aug '09 - 8:43 
GeneralRe: Does it work on vs.net 2008?membermmacneill12326 Jan '10 - 5:55 
GeneralRe: Does it work on vs.net 2008?memberJeff Roe27 Jan '10 - 13:21 
GeneralRe: Does it work on vs.net 2008? [modified]memberMember 79748688 Jun '11 - 3:08 
GeneralVS 2008 interop 2.0memberjohnp321021 Apr '09 - 9:58 
GeneralNever mind misunderstood somethingmemberjohnp321021 Apr '09 - 11:33 
QuestionGenerate Wrapper ErrormemberMember 185960731 Mar '09 - 18:12 
QuestionIs it a Interop UserControl version?memberhainanpc10 Aug '08 - 6:11 
General"lost" the InteropForm Wrapper C# Class GeneratormemberJohnBaima13 Feb '08 - 11:10 
GeneralRe: "lost" the InteropForm Wrapper C# Class GeneratormemberJohnBaima13 Feb '08 - 11:22 
GeneralRe: "lost" the InteropForm Wrapper C# Class Generatormemberscrapetoe28 Apr '08 - 3:01 
GeneralExpose custom properties and methods to host appmemberEdward Lane10 Sep '07 - 5:59 
GeneralRe: Expose custom properties and methods to host appmemberEdward Lane13 Sep '07 - 5:34 
GeneralRe: Expose custom properties and methods to host appmemberFessen11 Feb '09 - 21:52 
AnswerRe: Expose custom properties and methods to host appmemberSuperSly17 Feb '12 - 9:38 
GeneralError while loading adddinmemberAmit_bad9 Jul '07 - 21:35 
GeneralRe: Error while loading adddinmemberscrapetoe28 Apr '08 - 3:03 
GeneralRe: Error while loading adddinmemberscrapetoe28 Apr '08 - 4:13 
GeneralRe: Error while loading adddinmemberjohnp321021 Apr '09 - 11:35 
QuestionV2.0 Update?memberT. Brian Hughes25 May '07 - 4:41 
AnswerRe: V2.0 Update?memberBruce Armstrong12 Jul '07 - 19:13 
AnswerRe: V2.0 Update?memberBruce Armstrong12 Jul '07 - 19:34 
Generalsample code for my refmembermbalajhee23 Apr '07 - 4:27 
QuestionWhat about TAB???????memberhav29a19 Feb '07 - 2:54 
AnswerRe: What about TAB???????memberCosmicArts8 Aug '07 - 9:11 
Questioncan only add one formmemberclovisA1232 Feb '07 - 4:14 
QuestionHow to use with VS6 C++memberJoe Calabrese5 Jan '07 - 6:25 
General.Net user controls in Vb6memberKodici5 Jan '07 - 2:02 
QuestionHow to open c# form in MDIChild in VB6 ? [modified]memberlake117 Dec '06 - 4:23 
GeneralNew to .Net not sure of what the install entails.memberSkater Dude25 Oct '06 - 10:40 
GeneralRe: New to .Net not sure of what the install entails.memberLeon Langleyben25 Oct '06 - 21:36 
GeneralRe: New to .Net not sure of what the install entails.membergrxie10 Jul '07 - 10:23 
GeneralCall from vb6 creates a form not in project.memberUnderWing28 Sep '06 - 9:20 
GeneralRe: Call from vb6 creates a form not in project.memberLeon Langleyben3 Oct '06 - 7:19 
GeneralIt keeps generating wrappers in VB when using C#membermarioavc25 Sep '06 - 9:05 
AnswerRe: It keeps generating wrappers in VB when using C#memberLeon Langleyben25 Sep '06 - 11:42 
GeneralRe: It keeps generating wrappers in VB when using C#membermarioavc25 Sep '06 - 12:15 
GeneralRe: It keeps generating wrappers in VB when using C#memberLeon Langleyben25 Sep '06 - 12:09 
GeneralRe: It keeps generating wrappers in VB when using C#membermarioavc25 Sep '06 - 12:23 
GeneralRe: It keeps generating wrappers in VB when using C#memberLeon Langleyben27 Sep '06 - 2:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 2 Oct 2006
Article Copyright 2006 by Leon Langleyben
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid