Skip to content

Commit f243fe8

Browse files
committed
imported Documentation from Microsoft
1 parent 5818d75 commit f243fe8

File tree

230 files changed

+14614
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+14614
-0
lines changed
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2+
<html xmlns:mshelp="http://msdn.microsoft.com/mshelp">
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5+
<meta content="history" name="save">
6+
<title>Creating and Working with InteropForms</title>
7+
<link rel="stylesheet" type="text/css" href="../stylesheets/helpstudio.css">
8+
<link rel="stylesheet" type="text/css" href="../stylesheets/MSDN.css">
9+
<link rel="stylesheet" type="text/css" href="../stylesheets/tree.css">
10+
<style type="text/css">
11+
div#pagetop, div#pagetop table td, span#projecttitle, span#pagetitle
12+
{
13+
background-color: #90C8FF;
14+
color: #000080;
15+
}
16+
</style>
17+
<xml>
18+
<MSHelp:RLTitle Title="Structuring the Migration Process"/>
19+
<MSHelp:Attr Name="DocSet" Value="InteropFormToolkit2.0"/>
20+
<MSHelp:Attr Name="TopicType" Value="kbRef"/>
21+
<MSHelp:Attr Name="DevLang" Value="VB"/>
22+
<MSHelp:Keyword Index="F" Term="MicrosoftInteropFormToolkitIntroduction"/>
23+
</xml>
24+
</head>
25+
<body>
26+
<div id="pagetop">
27+
<table width="100%" id="pagetoptable1">
28+
<tr id="pagetoptable1row1">
29+
<td align="left">
30+
<span id="projecttitle">Interop Forms Toolkit </span>
31+
</td>
32+
<td align="right">
33+
<span id="feedbacklink">
34+
</td>
35+
</span> </td>
36+
</tr>
37+
<tr id="pagetoptable1row2">
38+
<td align="left" colspan="2">
39+
<span id="pagetitle">Creating and Working with InteropForms </span>
40+
</td>
41+
</tr>
42+
</table>
43+
</div>
44+
<div id="mainbody">
45+
<p>
46+
<strong>Overview</strong><br>
47+
This topic lists the tasks of involved in using the Interop Forms Toolkit to create
48+
.NET&nbsp;forms and&nbsp;make it accessible&nbsp;for use in&nbsp;a Visual Basic
49+
6.0 application.&nbsp; The tasks below walk through project setup and how to expose
50+
different&nbsp;form&nbsp;members to Visual Basic 6.0.&nbsp; The tasks&nbsp;can be
51+
read sequentially, for those new to the Toolkit, or jumped to individually for quick
52+
reference.&nbsp;</p>
53+
<p>
54+
&nbsp;</p>
55+
<p>
56+
<strong>Tasks</strong></p>
57+
<p>
58+
<a href="../How To/How To Configure a .NET InteropForm Project.html">Configure a .NET
59+
InteropForm Project</a></p>
60+
<p>
61+
<a href="../How To/How%20To%20Create%20a%20Form%20Property.html">Create a Form Property</a></p>
62+
<p>
63+
<a href="../How To/How%20To%20Create%20a%20Form%20Method.html">Create a Form Method</a></p>
64+
<p>
65+
<a href="../How To/How To Create an Initialize Method.html">
66+
Create an Initialize Method</a></p>
67+
<p>
68+
<a href="../How To/How%20To%20Create%20a%20Form%20Event.html">Create a Form Event</a></p>
69+
<p>
70+
<a href="../How To/How%20To%20Generate%20InteropForm%20Wrapper%20Classes.html">Generate InteropForm
71+
Wrapper Classes</a></p>
72+
<p>
73+
<a href="../How To/How%20To%20Configure%20the%20VB6%20Project.html">Configure the Visual Basic
74+
6.0 Project</a></p>
75+
<p>
76+
<a href="../How To/How%20To%20Instantiate%20an%20InteropForm.html">Instantiate an InteropForm</a></p>
77+
<p>
78+
<a href="../How To/How%20To%20Call%20an%20InteropForm%20Intialize%20Method.html">Call an InteropForm
79+
Initialize Method</a><a href="../How To/How To Call an InteropForm Intialize Method.html"></a></p>
80+
<p>
81+
<a href="../How To/How%20To%20Handle%20an%20InteropForm%20Event.html">Handle an InteropForm Event</a></p>
82+
<p>
83+
&nbsp;</p>
84+
<p>
85+
<strong><a name="TypeRestrictions"></a>Type Restrictions<br>
86+
</strong>One goal of this Interop Forms Toolkit is to keep development simple and
87+
straightforward, allowing developers to spend time developing features that add
88+
value instead of debugging Interop related issues.&nbsp; In keeping with that goal,
89+
only a subset of Types will be supported as parameters or return types for Interop
90+
members.&nbsp; They are:</p>
91+
<blockquote dir="ltr" style="margin-right: 0px">
92+
<p>
93+
<strong>&nbsp;Integer (Int32)<br>
94+
</strong><strong>&nbsp;String<br>
95+
</strong><strong>&nbsp;Boolean<br>
96+
</strong><strong>&nbsp;Object</strong></p>
97+
</blockquote>
98+
<p>
99+
A warning dialog will appear during the code generation process notifying the developer
100+
if a member will be skipped because it uses an unsupported type.</p>
101+
<p>
102+
&nbsp;</p>
103+
<p>
104+
Note: Object is supported to allow you to pass any custom object through and cast
105+
as needed.&nbsp;An example of this could be to pass a Recordset from Visual Basic
106+
6.0 to .NET.</p>
107+
<p>
108+
<strong><a name="Generate"></a></strong>
109+
</p>
110+
<p>
111+
&nbsp;</p>
112+
<p>
113+
<strong>InteropForm Behavioral Nuances</strong></p>
114+
<p>
115+
Since Visual Basic 6.0 Forms and .NET Forms are very different there are a few nuances
116+
to keep in mind while developing.</p>
117+
<ul>
118+
<li>Bringing a Visual Basic 6.0 Form to the front brings all Visual Basic 6.0 Forms
119+
to the front.</li>
120+
<li>A .NET form showing Visual Basic 6.0 form modally doesn't work. A Visual Basic 6.0
121+
Form is only modal to other Visual Basic 6.0 Forms.</li>
122+
<li>A Visual Basic 6.0 Form&nbsp;showing another Visual Basic 6.0 Form modally works;
123+
however, the modal form only "flickers" to indicate modality when another Visual
124+
Basic 6.0 form, not a .NET form,&nbsp;is&nbsp;clicked.</li>
125+
<li>InteropForms cannot be used as MDI Child forms in Visual Basic 6.0. If you want
126+
to extend an MDI Form, use an Interop User Control on a Visual Basic 6.0 MDI Child
127+
form and size it to fit the entire client area of the form.</li>
128+
</ul>
129+
<p>
130+
<strong><a name="SetuptheVB6Project"></a></strong>
131+
</p>
132+
<p>
133+
&nbsp;</p>
134+
<p>
135+
For more information on the working with the .NET InteropForm see <a href="The%20Development%20Experience.html">
136+
The Development Experience</a>.</p>
137+
<p>
138+
<br>
139+
&nbsp;</p>
140+
</div>
141+
<div id="pagefooter">
142+
<p>
143+
&nbsp;</p>
144+
<p>
145+
&nbsp;</p>
146+
<hr size="1">
147+
<p>
148+
Copyright &copy; by Microsoft Corporation. All Rights Reserved.
149+
</p>
150+
</div>
151+
</body>
152+
</html>
Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2+
<html xmlns:mshelp="http://msdn.microsoft.com/mshelp">
3+
<head>
4+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5+
<meta content="history" name="save">
6+
<title>Deploying Interop User Controls</title>
7+
<link rel="stylesheet" type="text/css" href="../stylesheets/helpstudio.css">
8+
<link rel="stylesheet" type="text/css" href="../stylesheets/MSDN.css">
9+
<link rel="stylesheet" type="text/css" href="../stylesheets/tree.css">
10+
<style type="text/css">
11+
div#pagetop, div#pagetop table td, span#projecttitle, span#pagetitle
12+
{
13+
background-color: #90C8FF;
14+
color: #000080;
15+
}
16+
</style>
17+
<xml>
18+
<MSHelp:RLTitle Title="Structuring the Migration Process"/>
19+
<MSHelp:Attr Name="DocSet" Value="InteropFormToolkit2.0"/>
20+
<MSHelp:Attr Name="TopicType" Value="kbRef"/>
21+
<MSHelp:Attr Name="DevLang" Value="VB"/>
22+
<MSHelp:Keyword Index="F" Term="MicrosoftInteropFormToolkitIntroduction"/>
23+
</xml>
24+
</head>
25+
<body>
26+
<div id="pagetop">
27+
<table width="100%" id="pagetoptable1">
28+
<tr id="pagetoptable1row1">
29+
<td align="left">
30+
<span id="projecttitle">Interop Forms Toolkit </span>
31+
</td>
32+
<td align="right">
33+
<span id="feedbacklink">
34+
</td>
35+
</span> </td>
36+
</tr>
37+
<tr id="pagetoptable1row2">
38+
<td align="left" colspan="2">
39+
<span id="pagetitle">Deploying Interop User Controls </span>
40+
</td>
41+
</tr>
42+
</table>
43+
</div>
44+
<div id="mainbody">
45+
<p>As with InteropForm assembles, Interop UserControls must be registered on
46+
the client computer. You can deploy them using the same techniques described in
47+
the topic <a href="Hybrid%20Application%20Deployment.html">Hybrid Application
48+
Deployment</a>, or if you are deploying to computers running Windows XP or
49+
later, you can deploy them side-by-side using the techniques described later in
50+
the topic.</p>
51+
<p>For an example of deploying with a Visual Studio .NET Setup and Deployment
52+
project, see <a href="../How To/How To Deploy A Hybrid Application.html">How
53+
To: Deploy a Hybrid Application</a>.</p>
54+
<blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
55+
<p><strong>Note:</strong> In&nbsp;most cases&nbsp;it is easier to deploy
56+
using the methods described in <a href=
57+
"../How To/How To Deploy A Hybrid Application.html">How To: Deploy a Hybrid
58+
Application</a>. Deploying with Reg-Free COM requires more effort, but
59+
works best when you want to have a minimal impact to your existing setup
60+
package (i.e. a Setup created using the Package &amp; Deployment Wizard).
61+
Since no additional registry entries are required, deploying your new
62+
application is as simple as updating your package to copy the new .NET
63+
.dlls and .manifest file to the application folder.</p>
64+
</blockquote>
65+
<p><strong>Deploying Side-by-side with Reg-Free COM</strong></p>
66+
<p>Windows XP provides a mechanism known as Reg-Free COM&nbsp;for deploying COM
67+
objects without requiring registry entries. This allows you to deploy Interop
68+
UserControls as&nbsp;.dll files that install in the same directory as your
69+
application .exe. If you include a .manifest file in the application directory,
70+
the .exe can find and use the Interop UserControl even though it is not
71+
registered as a COM object. This also allows you to deploy your Visual Basic
72+
6.0 application using the newer ClickOnce deployment technology, which does not
73+
support COM registration.</p>
74+
<p><strong>Note&nbsp;</strong>&nbsp; The Interop UserControl will still need to
75+
registered on the development machine, since Visual Basic 6.0 pre-dates
76+
Reg-Free COM.</p>
77+
<p>In order to deploy your Interop UserControl with Reg-Free COM, you will need
78+
both a client manifest (for the application) and a private assembly manifest
79+
(for the UserControl). The private assembly manifest is automatically generated
80+
by the Visual Basic 6.0 Interop UserControl template, but you need to create
81+
the client manifest yourself and add it to your Visual Basic 6.0 application
82+
directory.</p>
83+
<p>You can create the manifest file in the XML editor in Visual Studio .NET, or
84+
you can create it using a text editor such as Notepad. The following is an
85+
example of a client manifest:</p>
86+
<p><font face="Courier New">&lt;?xml version="1.0" encoding="UTF-8"
87+
standalone="yes"?&gt;<br>
88+
&lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1"
89+
manifestVersion="1.0"&gt;<br>
90+
&nbsp;&nbsp;&nbsp; &lt;assemblyIdentity type="win32" name="<em>MyApp</em>"
91+
version="1.0.0.0" processorArchitecture="x86" /&gt;<br>
92+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;dependency&gt;<br>
93+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
94+
&lt;dependentAssembly&gt;<br>
95+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
96+
&lt;assemblyIdentity type="win32" name="<em>MyUserControl</em>"
97+
version="1.0.0.0" /&gt;<br>
98+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
99+
&lt;/dependentAssembly&gt;<br>
100+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/dependency&gt;<br>
101+
&lt;/assembly&gt;</font></p>
102+
<p>The name "<em>MyApp</em>" should be replaced by the name of your Visual
103+
Basic 6.0 .exe, and the name "<em>MyUserControl</em>" should be replaced by the
104+
name of your Interop UserControl .dll; the .exe and .dll extensions should not
105+
be included.&nbsp;In addition, the version numbers should be updated to match
106+
the versions of your .exe and .dll.</p>
107+
<p>The manifest file must be named <em>MyApp</em>.exe.manifest, where
108+
<em>MyApp</em> is the name of your Visual Basic 6.0 .exe. During deployment,
109+
the .exe, the client manifest, and the .dll must all be installed to the same
110+
directory on the client computer. When the application loads, Windows inspects
111+
the manifest and determines that the application uses Reg-Free COM, and then
112+
loads the .dll from the specified location.</p>
113+
<p><strong>Private Assembly Manifest</strong></p>
114+
<p>The&nbsp;Visual Basic 6.0 Interop UserControl template creates a private
115+
assembly manifest for your control named InteropUserControl.manifest. In most
116+
case you will never need to touch this file, but if you make changes to the
117+
name of the project or the class you will need to update the manifest to
118+
reflect your changes. You will also need to update this file if you add more
119+
than one Interop UserControl to your project (the first
120+
<strong>clrClass</strong> entry is automatically filled in, but additional ones
121+
must be&nbsp;added manually). The following is an example of a private assembly
122+
manifest; the italicized elements are the ones that might need to be
123+
changed:</p>
124+
<p><font face="Courier New">&lt;?xml version="1.0" encoding="UTF-8"
125+
standalone="yes"?&gt;<br>
126+
&lt;!-- You don't need to worry about anything in this file unless you're<br>
127+
&nbsp;&nbsp;&nbsp;&nbsp; using Reg-free COM. --&gt;<br>
128+
&lt;assembly xmlns="urn:schemas-microsoft-com:asm.v1"<br>
129+
&nbsp; manifestVersion="1.0"&gt;<br>
130+
&lt;assemblyIdentity<br>
131+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
132+
type="win32"<br>
133+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
134+
name="<em>MyUserControl</em>"<br>
135+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
136+
version="1.0.0.0" /&gt;<br>
137+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;clrClass</font></p>
138+
<p><font face=
139+
"Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clsid="<em>
140+
{Insert GUID here}</em>"</font></p>
141+
<p><font face=
142+
"Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
143+
progid="<em>MyUserControl.MyUserControlClass</em>"</font></p>
144+
<p><font face=
145+
"Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
146+
threadingModel="Both"</font></p>
147+
<p><font face=
148+
"Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name="<em>
149+
MyUserControl.MyUserControlClass</em>" &gt;</font></p>
150+
<p><font face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
151+
&lt;/clrClass&gt;</font></p>
152+
<p><font face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
153+
&lt;clrClass</font></p>
154+
<p><font face=
155+
"Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clsid="<em>
156+
{Insert GUID here}</em>"</font></p>
157+
<p><font face=
158+
"Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
159+
progid="<em>MyUserControl.SecondUserControlClass</em>"</font></p>
160+
<p><font face=
161+
"Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
162+
threadingModel="Both"</font></p>
163+
<p><font face=
164+
"Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name="<em>
165+
MyUserControl.SecondUserControlClass</em>" &gt;</font></p>
166+
<p><font face="Courier New">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
167+
&lt;/clrClass&gt;</font><br>
168+
&lt;/assembly&gt;</p>
169+
<p>In the above example, the value for&nbsp;clsid&nbsp;would be
170+
the&nbsp;ClassID found in your COM registration section of the
171+
<em>UserControl</em>.vb file. For progid and name,
172+
<em>MyUserControl</em>&nbsp;would be the name of your UserControl assembly,
173+
and&nbsp;<em>MyUserControlClass</em>&nbsp;would be the&nbsp;name of your
174+
UserControl class. To add multiple UserControls in a single assembly, add a
175+
&lt;clrClass&gt; element for each UserControl.</p>
176+
<p>In addition, there is a hidden file named InteropUserControl.rc that must be
177+
updated when you change the project or class name. You can view this file in
178+
Solution Explorer by choosing Show All Files. The following is an example of
179+
the .rc file; the italicized elements are the ones that might need to be
180+
changed:</p>
181+
<p><font face="Courier New">#define RT_MANIFEST 24</font></p>
182+
<p><font face="Courier New">1 RT_MANIFEST
183+
<em>MyUserControl</em>.manifest</font></p>
184+
<p><font face="Courier New">101 BITMAP <em>MyUserControl</em>.bmp</font></p>
185+
<p><font face="Courier New"><font face="Verdana">For more information
186+
about&nbsp;Reg-Free COM, see <a href=
187+
"http://msdn2.microsoft.com/en-us/library/eew13bza.aspx">How to: Configure .NET
188+
Components for Registration-Free Activation</a>.</font></font></p>
189+
</div>
190+
<div id="pagefooter">
191+
<p>
192+
&nbsp;</p>
193+
<p>
194+
&nbsp;</p>
195+
<hr size="1">
196+
<p>
197+
Copyright &copy; by Microsoft Corporation. All Rights Reserved.
198+
</p>
199+
</div>
200+
</body>
201+
</html>

0 commit comments

Comments
 (0)