A group blog from members of the VB team
a) Use the Interop Forms Toolkit to build Interop Usercontrols instead of Interop Forms.
b) Remove the reference to Microsoft.InteropForms.dll library unless you plan on taking advantage of some of it's functionality such as the Globals class (for sharing state) or the EventMessenger class (for raising application-level events).
c) Configure your usercontrol manifest appropriately and create an application manifest for your VB6 app so you can take advantage of Reg-free COM
d) Modify your legacy setup to copy over your new usercontrol binary and the application manifest into your application folder.
1) The recommended approach is to use the bootstrapper technology in VS 2005 to deploy any prereqs you need. You can create a custom bootstrapper which installs prereqs like the .net framework only if necessary and in a secure way. These prereqs that the bootstrapper supports are typically called "bootstrapper packages" and you can see what's available on your machine by going to the Publish tab in the project designer and clicking on "Prerequisites" button.
A "custom bootstrapper" is basically a special "setup.exe" that is built by VS that understands what prereqs are needed for your application. Once the prereqs are installed, it will launch whatever you want - typically the application setup. If you ever build a Setup and Deployment project in VS or publish a Clickonce app, the "setup.exe" that is created is a custom bootstrapper.
2) Alternatively, you can roll your own approach (use batch file, etc...) which I won't go into detail here.
1) Create a VS Setup and Deployment project and add your InteropForms assembly to it. Also, make sure you set the register property to vsdraCOM so that will get globally registered on the machine and build your .msi
2) Create a bootstrapper package for this .msi and then add this package to your custom bootstrapper.
a) Your setup is frozen (or you cannot modify it).
In this case, you can create a custom bootstrapper to install all prereqs that your application needs (whatever component you created in (2) above). You will end up with a single setup.exe which will launch and setup everything the application needs.
b) Your setup is a windows .msi file created in VS. In this case, you can just add the appropriate logic for installing your assembly (see (2) above) and you can just goto the Prerequisites dialog for the setup project and rebuild your .msi. VS will create a custom bootstrapper (the setup.exe) that installs all needed prerequisites.
c) Your setup is created with the VB6 package and deployment wizard or some other technology and you can modify it. Depending on (1) above - namely, if you need to install prerequisites, you might want to create a custom bootstrapper to "wrap" your legacy setup. Depending on (2), you can either just add your files to your setup (if you use RegFree COM and Interop Usercontrols), or can do something custom for your setup.
Is there any easy way to configure and create manifests for our VB6 exe and our .NET dlls so that regasm doesn't have to be used at all on the target PC? By easy I mean no resource compiling or multi-step .net compiles.
Interested users should check out this post as well which contains a more detailed description of deploying using Reg-Free COM plus explains how to deploy VB6 apps using ClickOnce.
ChrisW: On your comment above, i'm not entirely clear what you mean. Assuming you use regfree COM, regasm.exe doesn't need to be on the target PC. If you want, mail me at my name (minus the _MS) @microsoft.com and we can discuss.
I apologize right away that it's been a while since I've blogged about the interop forms toolkit although
I have been working on several Visual Basic projects recently, so thought it would be useful to signpost
前に Interop Forms Toolkit についてブログを書いて以来、時間が経ってしまったことを お詫び します。この件については、常に最新の情報を得るように努めてきましたし、 相互運用のフォーラム
Paul Maher, Microsoft UK Developer & Platform group, has pulled together some useful material for
Ok. I have an interop toolkit 2.0 Usercontrol that was built by another developer. I have NO source code for it at all just the compiled DLL how do i get it to appear in my VB6 toolbox so I can use it, anybody out there know?
Hey Mel, all you have to is run regasm.exe <name of usercontrol>.dll and after that you'll be able to see it in VB6.
It won't appear in the toolbox by default, you'll have to click Project->Components and select it from the list. For more information I'd recommend reading the walkthroughs that are included in the Interop Toolkit help docs.
Hope that helps,
If I want to use the Interop usercontrol in other development computer with VB6/Office programming, I need to register the type library of this control.
I'm using vb.net InteropControl devloped using visual studio 2008 with vb.net. I'm using same control as ole in PowerBuilder. This interop control works fine on developer machine where both visual studio and powerbuilder 10.5 is installed. But client's machine is window 7. On that machine Visual Studion 2008 is not installed, but It has PowerBuilder 10.5. Problem is, that InterOP control is not working. Client machine has dot net frame work 2 and above. I have tried to register interop control dll with regsam. That dll gets register but I'm not able to access it's functions or methods.
Am i missing any thing ?
Any help in this regards will be highly appreciated.