"InteropUserControl"
Hello Everybody here,
Interop Forms Toolkit 1.0 seems to be very nice.
Unfortunately the VB Express Edition has no Addin in the Tools menu for generating InteropForm Wrapper Classes.
To do it manual seems not to be so easy...
Any other possibilities?
With greetings from Germany
Josef
Hi Josef,
You're right VB Express doesn't have Addin support, but there's another way you can still get Interop to work. On the VB team blog we recently released an "Interop UserControl" prototype that you can use in VB Express. You can think of it as the InteropForm Toolkit but working in a UserControl instead of just Forms.
http://blogs.msdn.com/vbteam/archive/2006/11/02/interop-roadmap-usercontrols-mdi-and-data.aspx
Please try out the template and let us know how it works for you, we're really interested in your feedback.
Thanks,
Jonathan
Hello Jonathan,
the tool now appears on my VB6 | SP5 - Toolbox.
Putting it on a VB6 form shuts VB down.
VB has to be started again.
Same procedure again, but no change to save changes of the form.
Can You please provide a Help- or Instruction-File for using "Interop UserControl"?
Additional SysInfo:
WinXP HomeEdition SP2 + all security Updates
Office XP Developer
IE7 english
Thanks,
Josef
Hi Josef,
What's the error message you're seeing in VB6?
Please try the following steps and let me know if it works for you:
1. Click File->New Project
2. Select the Interop UserControl template and call it "VB6ControlTest"
3. Drop a textbox on the design surface
4. Build the control
5. Load VB6, create a new project
6. Right-click on your toolbox and click Components
7. Find your control (VB6ControlTest) and select it and click OK.
8. From the toolbox drag it on to your VB6 Form.
9. Press F5
Hope that helps,
Jonathan
Hi Jonathan,
well me did it almost the same way as described in Your instructions.
With Your and my way the same thing:
VB6 quits without an error message. Don't know if it has to do something with installed beta "Live OneCare"?
What also is not clear:
6. Right-click on your toolbox and click Components
7. Find your control (VB6ControlTest) and select it and click OK.
=> VB6 shows "VB6ControlTest" but "mscoree.dll" as Path!
Now I'm going on with Interop Forms Toolkit 1.0
Copying manual a "mini"-Wrapper Class to my solution (see end of this file) as start seems to be enough.
And it works with the MS-Samples "WindowsAPICalls" and "Environment" even in a VBA-Project with Access-XP!
Thanks,
Josef
My "mini"-Wrapper Class:
Imports
Microsoft.InteropFormToolsNamespace
Interop<System.Runtime.InteropServices.ClassInterface(Runtime.InteropServices.ClassInterfaceType.AutoDual), _
System.Runtime.InteropServices.ComVisible(True)> _
Partial Public Class MainFormAPI
Inherits InteropFormProxyBase
Public Sub New()
MyBase.New()
FormInstance = New WindowsAPICalls.MainFormAPI()
RegisterFormInstance()
End Sub
End Class
End Namespace
Hi Josef,
I'm surprised that VB6 is shutting down on you...if you see an error message please let us know. The fact that you're seeing mscoree.dll is expected behavior: this is the file the .NET Framework uses to load the CLR into memory when called by COM. Basically it's the file that handles creating your .NET object for VB6.
Hope that helps,
Jonathan
Hi Jonathan,
after a complete new installation of my computer (WinXP, VB6/Net, Office/Developer, IE7) the "InteropUserControl" works now!
When will we get the finalized version of the "InteropUserControl"?
Thanks for Your help,
Josef