Click here to Skip to main content
Licence CPOL
First Posted 24 Sep 2006
Views 87,227
Downloads 1,234
Bookmarked 21 times

VB6 - C# Interop Form Toolkit

By | 2 Oct 2006 | Article
Interop Form Toolkit was released few days ago. It allows an easy creation of mixed VB6/VB.NET application. One thing it is missing is the ability to do it in C#.
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

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 5 Pinmembermanoj kumar choubey19:13 14 Mar '12  
SuggestionSolved: Problems with Visual Studio 2010, AddIn not loaded or/and Wrapper still in VB.Net Pinmemberarkimboldo2:19 2 Aug '11  
GeneralProblems with Visual Studio 2008 and Interop Forms ToolKit 2.1 Pinmembergcantarini3:52 13 Jul '10  
QuestionHow to attach c# code as VB6 control Pinmemberajovanov6:33 7 Jul '10  
GeneralFYI - recompile the source for VS2010 Pinmembermmacneill1233:46 10 Jun '10  
GeneralProblem creating interop form using VS2008 Pinmembertrpugh8:27 29 Aug '09  
QuestionDoes it work on vs.net 2008? Pinmemberdevnet2475:26 8 May '09  
AnswerRe: Does it work on vs.net 2008? PinmemberEddy Vluggen8:43 21 Aug '09  
GeneralRe: Does it work on vs.net 2008? Pinmembermmacneill1235:55 26 Jan '10  
GeneralRe: Does it work on vs.net 2008? PinmemberJeff Roe13:21 27 Jan '10  
GeneralRe: Does it work on vs.net 2008? [modified] PinmemberMember 79748683:08 8 Jun '11  
GeneralVS 2008 interop 2.0 Pinmemberjohnp32109:58 21 Apr '09  
GeneralNever mind misunderstood something Pinmemberjohnp321011:33 21 Apr '09  
QuestionGenerate Wrapper Error PinmemberMember 185960718:12 31 Mar '09  
Hi there,
 
Was wondering if you can help me. If i create a Forms folder in my .net project and place my interop forms within this new folder when i go to generate my wrapper class i get an error. But if i move the interop forms out of the Forms folder and into the base directory it works fine.
 
Please help if you can as i wont to place all my forms into a forms folder for a large scale hybrid vb6 and .net application.
 
Thanks
QuestionIs it a Interop UserControl version? Pinmemberhainanpc6:11 10 Aug '08  
General"lost" the InteropForm Wrapper C# Class Generator PinmemberJohnBaima11:10 13 Feb '08  
GeneralRe: "lost" the InteropForm Wrapper C# Class Generator PinmemberJohnBaima11:22 13 Feb '08  
GeneralRe: "lost" the InteropForm Wrapper C# Class Generator Pinmemberscrapetoe3:01 28 Apr '08  
GeneralExpose custom properties and methods to host app PinmemberEdward Lane5:59 10 Sep '07  
GeneralRe: Expose custom properties and methods to host app PinmemberEdward Lane5:34 13 Sep '07  
GeneralRe: Expose custom properties and methods to host app PinmemberFessen21:52 11 Feb '09  
AnswerRe: Expose custom properties and methods to host app PinmemberSuperSly9:38 17 Feb '12  
GeneralError while loading adddin PinmemberAmit_bad21:35 9 Jul '07  
GeneralRe: Error while loading adddin Pinmemberscrapetoe3:03 28 Apr '08  
GeneralRe: Error while loading adddin Pinmemberscrapetoe4:13 28 Apr '08  

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

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