<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Bahramov's Personal Blog &#187; Coding</title>
	<atom:link href="http://www.bahramov.com/tag/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bahramov.com</link>
	<description>Computers, databases, networks and virtualization</description>
	<lastBuildDate>Fri, 24 Jun 2011 12:05:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Open / Close CD ROM in Visual Basic</title>
		<link>http://www.bahramov.com/2009/03/23/open-close-cd-rom-in-visual-basic/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://www.bahramov.com/2009/03/23/open-close-cd-rom-in-visual-basic/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 22:06:32 +0000</pubDate>
		<dc:creator>Zaur Bahramov</dc:creator>
				<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.bahramov.com/?p=149</guid>
		<description><![CDATA[This code demonstrates how to create CD ROM open and close calls. Create a Windows Forms Application and add two buttons. I will leave default names in this example Form1 for the form and Button1 and Button2 for buttons. Iâ€™ve changed the text property only.

Click F7 to go to the code view and add the [...]]]></description>
			<content:encoded><![CDATA[<p>This code demonstrates how to create CD ROM open and close calls. Create a Windows Forms Application and add two buttons. I will leave default names in this example Form1 for the form and Button1 and Button2 for buttons. Iâ€™ve changed the text property only.</p>
<p><a href="http://www.bahramov.com/wp-content/uploads/2009/03/form1.jpg#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" title="form1"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="form1" src="http://www.bahramov.com/wp-content/uploads/2009/03/form1-thumb.jpg" border="0" alt="form1" width="244" height="118" /></a></p>
<p><span id="more-149"></span>Click F7 to go to the code view and add the folowing code:</p>
<pre class="brush: vb.net">
&#039; Form design
&#039; - - - - - -
&#039; Button1 â€“ Button control
&#039; Button2 â€“ Button control
&#039; - - - - - -
&#039; Form code

Public Class Form1
Private Declare Function mciSendString Lib &quot;winmm.dll&quot; Alias _
&quot;mciSendStringA&quot; (ByVal lpstrCommand As String, ByVal _
lpstrReturnString As Long, ByVal uReturnLength As _
Long, ByVal hwndCallback As Long) As Long

Dim vDrive As String
Dim vAlias As String

Private Sub Button1_Click() Handles Button1.Click
&#039; Open
vDrive = &quot;f:/&quot;
vAlias = &quot;vv&quot; &amp; vDrive
Call mciSendString(&quot;Open &quot; &amp; vDrive &amp; &quot;: Alias &quot; &amp; vAlias &amp; _
&quot; Type CDAudio&quot;, 0, 0, 0)
Call mciSendString(&quot;Set &quot; &amp; vAlias &amp; &quot; Door Open&quot;, 0, 0, 0)
End Sub

Private Sub Button2_Click() Handles Button2.Click
&#039; Close
vDrive = &quot;f:/&quot;
vAlias = &quot;vv&quot; &amp; vDrive
Call mciSendString(&quot;Open &quot; &amp; vDrive &amp; &quot;: Alias &quot; &amp; vAlias &amp; _
&quot; Type CDAudio&quot;, 0, 0, 0)
Call mciSendString(&quot;Set &quot; &amp; vAlias &amp; &quot; Door Closed&quot;, 0, 0, 0)
End Sub
End Class</pre>
<p>Click F5 to Run the application.</p>
<p><a href="http://www.bahramov.com/wp-content/uploads/2009/03/windowsapplication1.zip#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" target="_self">Download sample</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bahramov.com/2009/03/23/open-close-cd-rom-in-visual-basic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Log Off, Restart and Shutdown PC in Visual Basic</title>
		<link>http://www.bahramov.com/2009/03/23/how-to-log-off-restart-and-shutdown-pc-in-visual-basic/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://www.bahramov.com/2009/03/23/how-to-log-off-restart-and-shutdown-pc-in-visual-basic/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 08:29:10 +0000</pubDate>
		<dc:creator>Zaur Bahramov</dc:creator>
				<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.bahramov.com/?p=117</guid>
		<description><![CDATA[Hereâ€™s a small example of how to log off, restart and shutdown computer in Visual Basic. Open Visual Studio and create a new Windows Forms Application:

In the Solution Explorer right-click on ExitWindows â€“&#62; Add â€“&#62; Moduleâ€¦ Leave the default name Module1.vb as is and click Add.
Paste the following code in Module1:
Public Declare Function ExitWindows Lib [...]]]></description>
			<content:encoded><![CDATA[<p>Hereâ€™s a small example of how to log off, restart and shutdown computer in Visual Basic. Open Visual Studio and create a new Windows Forms Application:</p>
<p><a href="http://www.bahramov.com/wp-content/uploads/2009/03/01.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" title="01"><img style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" title="01" src="http://www.bahramov.com/wp-content/uploads/2009/03/01-thumb.png" border="0" alt="01" width="244" height="179" /></a></p>
<p>In the Solution Explorer right-click on ExitWindows â€“&gt; Add â€“&gt; Moduleâ€¦ Leave the default name Module1.vb as is and click Add.</p>
<p>Paste the following code in Module1:</p>
<pre class="code"><span style="color: blue">Public Declare Function </span>ExitWindows <span style="color: blue">Lib </span><span style="color: #a31515">"user32" </span>(<span style="color: blue">ByVal </span>uFlags <span style="color: blue">As Long</span>, _
<span style="color: blue">ByVal </span>dwReserved <span style="color: blue">As Long</span>) <span style="color: blue">As Long

Public Const </span>EWX_LOGOFF = 0
<span style="color: blue">Public Const </span>EWX_SHUTDOWN = 1
<span style="color: blue">Public Const </span>EWX_REBOOT = 2
<span style="color: blue">Public Const </span>EWX_FORCE = 4</pre>
<p><span id="more-117"></span></p>
<p>Now, go to Form1.vb and add three buttons from the toolbox. Set the following properties for buttons:</p>
<table border="0" cellspacing="0" cellpadding="2" width="400">
<tbody>
<tr>
<td width="95" valign="top">Button1:</td>
<td width="305" valign="top"><strong>Name</strong>:Â  btnLogOff</p>
<p><strong>Text</strong>:Â Â Â  Log Off</td>
</tr>
<tr>
<td width="95" valign="top">Button2:</td>
<td width="305" valign="top"><strong>Name</strong>:Â  btnReboot</p>
<p><strong>Text</strong>:Â Â Â  Reboot</td>
</tr>
<tr>
<td width="95" valign="top">Button3:</td>
<td width="305" valign="top"><strong>Name</strong>:Â  btnShutdown</p>
<p><strong>Text</strong>:Â Â Â  Shutdown</td>
</tr>
</tbody>
</table>
<p>Click F7 and paste the following code:</p>
<pre class="code"><span style="color: blue">Public Class </span>Form1
    <span style="color: blue">Dim </span>s <span style="color: blue">As Long

    Private Sub </span>btnLogOff_Click(<span style="color: blue">ByVal </span>sender <span style="color: blue">As </span>System.Object, _
    <span style="color: blue">ByVal </span>e <span style="color: blue">As </span>System.EventArgs) <span style="color: blue">Handles </span>btnLogOff.Click
        <span style="color: green">' Logoff current user
        </span>s = ExitWindows(EWX_LOGOFF, 0&amp;)
    <span style="color: blue">End Sub

    Private Sub </span>btnReboot_Click(<span style="color: blue">ByVal </span>sender <span style="color: blue">As </span>System.Object, _
    <span style="color: blue">ByVal </span>e <span style="color: blue">As </span>System.EventArgs) <span style="color: blue">Handles </span>btnReboot.Click
        <span style="color: green">' Reboot computer
        </span>s = ExitWindows(EWX_REBOOT, 0&amp;)
    <span style="color: blue">End Sub

    Private Sub </span>btnShutdown_Click(<span style="color: blue">ByVal </span>sender <span style="color: blue">As </span>System.Object, _
    <span style="color: blue">ByVal </span>e <span style="color: blue">As </span>System.EventArgs) <span style="color: blue">Handles </span>btnShutdown.Click
        <span style="color: green">' Shutdown computer
        </span>s = ExitWindows(EWX_SHUTDOWN, 0&amp;)
    <span style="color: blue">End Sub
End Class
</span></pre>
<p>Thatâ€™s it <img src="http://messenger.msn.com/MMM2006-04-19_17.00/Resource/emoticons/regular_smile.gif" alt="Smile" />. Download the solution from the link below.</p>
<div id="scid:8eb9d37f-1541-4f29-b6f4-1eea890d4876:0768d2a2-b5bd-4c7e-a094-e0da0520931b" class="wlWriterEditableSmartContent" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<div><a href="http://www.bahramov.com/wp-content/uploads/2009/03/exitwindows2.zip#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" target="_self">ExitWindows.zip</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.bahramov.com/2009/03/23/how-to-log-off-restart-and-shutdown-pc-in-visual-basic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some links for Windows scriptingâ€¦ (Microsoft)</title>
		<link>http://www.bahramov.com/2009/03/20/some-links-for-windows-scripting-microsoft/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://www.bahramov.com/2009/03/20/some-links-for-windows-scripting-microsoft/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 14:31:33 +0000</pubDate>
		<dc:creator>Zaur Bahramov</dc:creator>
				<category><![CDATA[Microsoft Guides]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[VBScript]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://www.bahramov.com/?p=107</guid>
		<description><![CDATA[Scripting tools and utilities

Scriptomatic 2.0
Do-It-Yourself Script Center Kit
WMI Code Creator
ADSI Scriptomatic
Tweakomatic
Log Parser 2.2
Portable Script Center
HTA Helpomatic
Scriptomatic 1.0


Script center
Learn to Script
The Script Center Script Repository
The Windows PowerShell Toolbox

Documentation
â€¢ Sesame Script
Every Sesame Script article through June 2007 in one downloadable Help file.
â€¢ Hey, Scripting Guy!
Almost 500 Hey, Scripting Guy! articles, fully searchable.
â€¢ Windows PowerShell Help File
Fully-searchable help [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.microsoft.com/technet/scriptcenter/createit.mspx" target="_blank">Scripting tools and utilities</a></p>
<ul>
<li><a href="http://www.microsoft.com/technet/scriptcenter/tools/scripto2.mspx">Scriptomatic 2.0</a></li>
<li><a href="http://www.microsoft.com/technet/scriptcenter/tools/diy.mspx">Do-It-Yourself Script Center Kit</a></li>
<li><a href="http://www.microsoft.com/downloads/info.aspx?na=22&amp;p=6&amp;SrcDisplayLang=en&amp;SrcCategoryId=&amp;SrcFamilyId=&amp;u=%2fdownloads%2fdetails.aspx%3fFamilyID%3d2cc30a64-ea15-4661-8da4-55bbc145c30e%26DisplayLang%3den">WMI Code Creator</a></li>
<li><a href="http://www.microsoft.com/technet/scriptcenter/tools/admatic.mspx">ADSI Scriptomatic</a></li>
<li><a href="http://www.microsoft.com/technet/scriptcenter/tools/twkmatic.mspx">Tweakomatic</a></li>
<li><a href="http://www.microsoft.com/technet/scriptcenter/tools/logparser/default.mspx">Log Parser 2.2</a></li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=b4cb2678-dafb-4e30-b2da-b8814fe2da5a&amp;DisplayLang=en">Portable Script Center</a></li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=231D8143-F21B-4707-B583-AE7B9152E6D9&amp;displaylang=en">HTA Helpomatic</a></li>
<li><a href="http://www.microsoft.com/technet/scriptcenter/tools/wmimatic.mspx">Scriptomatic 1.0</a></li>
</ul>
<p><span id="more-107"></span></p>
<ul><a href="http://www.microsoft.com/technet/scriptcenter/default.mspx" target="_blank">Script center</a><br />
<a href="Learn to Script#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed" target="_blank">Learn to Script</a><br />
<a href="http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=true" target="_blank">The Script Center Script Repository</a><br />
<a href="http://www.microsoft.com/technet/scriptcenter/topics/winpsh/toolbox.mspx" target="_blank">The Windows PowerShell Toolbox</a></p>
<h6></h6>
<h6>Documentation</h6>
<p>â€¢ <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=FF973FBE-9382-4E4C-80DE-E7DE14FD83E6&amp;displaylang=en">Sesame Script</a><br />
Every <a href="http://www.microsoft.com/technet/scriptcenter/resources/begin/archive.mspx">Sesame Script</a> article through June 2007 in one downloadable Help file.</p>
<p>â€¢ <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=5f5e0bda-923a-4744-8289-afb73f6a5ed8&amp;displaylang=en">Hey, Scripting Guy!</a><br />
Almost 500 <a href="http://www.microsoft.com/technet/scriptcenter/resources/qanda/hsgarch.mspx">Hey, Scripting Guy!</a> articles, fully searchable.</p>
<p>â€¢ <a href="http://www.microsoft.com/technet/scriptcenter/topics/winpsh/pschm.mspx">Windows PowerShell Help File</a><br />
Fully-searchable help for Windows PowerShell.</p>
<p>â€¢ <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=9C80B0DF-B9B4-4FCB-B513-02F8F40049E8&amp;displaylang=en">VBScript Quick Reference</a><br />
Short and to-the-point cheat sheet for working with VBScript.</p>
<p>â€¢ <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=DF8ED469-9007-401C-85E7-46649A32D0E0&amp;displaylang=en">Windows PowerShell Quick Reference</a><br />
The basics of Windows PowerShell at your fingertips.</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.bahramov.com/2009/03/20/some-links-for-windows-scripting-microsoft/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a custom DLL in Visual Basic .NET</title>
		<link>http://www.bahramov.com/2009/03/18/vbnet-tutorial-creating-a-custom-dll-dynamic-link-library-in-visual-basic-net/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://www.bahramov.com/2009/03/18/vbnet-tutorial-creating-a-custom-dll-dynamic-link-library-in-visual-basic-net/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 15:36:00 +0000</pubDate>
		<dc:creator>Zaur Bahramov</dc:creator>
				<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[VB]]></category>

		<guid isPermaLink="false">http://www.bahramov.com/?p=27</guid>
		<description><![CDATA[One of the best programming practices is to use DLL (Dynamic Link Library) files to re-use your code and controls across your applications. In this tutorial I will show you how to create a sample DLL file in Visual Basic .NET Professional edition and attach it to a new application.
1)Â Â Â  Create a new project, select [...]]]></description>
			<content:encoded><![CDATA[<p>One of the best programming practices is to use DLL (Dynamic Link Library) files to re-use your code and controls across your applications. In this tutorial I will show you how to create a sample DLL file in Visual Basic .NET Professional edition and attach it to a new application.</p>
<p>1)Â Â Â  Create a new project, select Windows Forms Control Library and name it MiniCalc</p>
<p><a href="http://www.bahramov.com/images/articles/vb/1/01.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><span style="font-size: 12pt; font-family: Verdana;" lang="EN-GB"><img src="../../images/articles/vb/1/01.png" alt="" width="477" height="348" /></span></a></p>
<p><span id="more-27"></span>2)Â Â Â  You will see that the new UserControl1.vb is added to your project. Right-click on the UserControl1.vb and select Rename from the menu. Name it MiniCalc.vb</p>
<p><a href="http://www.bahramov.com/images/articles/vb/1/02.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><span style="font-size: 12pt; font-family: Verdana;" lang="EN-GB"><img src="../../images/articles/vb/1/02.png" alt="" width="261" height="276" /></span></a></p>
<p>3)Â Â Â  Go to the Toolbox and add 1 groupbox, 2 textboxes, 4 buttons and 1 label. Align them on the control as on the following image:</p>
<p><a href="http://www.bahramov.com/images/articles/vb/1/03.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><span style="font-size: 12pt; font-family: Verdana;" lang="EN-GB"><img src="../../images/articles/vb/1/03.png" alt="" width="197" height="177" /></span></a></p>
<p>Set the following properties:</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr bgcolor="#cccccc">
<td colspan="2" valign="top" bordercolor="#000000"><strong>TextBox1</strong></td>
</tr>
<tr>
<td width="132" valign="top" bordercolor="#000000">Name</td>
<td width="216" valign="top" bordercolor="#000000">txtValue1</td>
</tr>
<tr bgcolor="#cccccc">
<td colspan="2" valign="top" bordercolor="#000000"><strong>TextBox2</strong></td>
</tr>
<tr>
<td width="132" valign="top" bordercolor="#000000">Name</td>
<td width="216" valign="top" bordercolor="#000000">txtValue2</td>
</tr>
<tr bgcolor="#cccccc">
<td colspan="2" valign="top" bordercolor="#000000"><strong>Button1</strong></td>
</tr>
<tr>
<td width="132" valign="top" bordercolor="#000000">Name</td>
<td width="216" valign="top" bordercolor="#000000">btnPlus</td>
</tr>
<tr>
<td width="132" valign="top" bordercolor="#000000">Text</td>
<td width="216" valign="top" bordercolor="#000000">+</td>
</tr>
<tr bgcolor="#cccccc">
<td colspan="2" valign="top" bordercolor="#000000"><strong>Button2</strong></td>
</tr>
<tr>
<td width="132" valign="top" bordercolor="#000000">Name</td>
<td width="216" valign="top" bordercolor="#000000">btnMinus</td>
</tr>
<tr>
<td width="132" valign="top" bordercolor="#000000">Text</td>
<td width="216" valign="top" bordercolor="#000000">-</td>
</tr>
<tr bgcolor="#cccccc">
<td colspan="2" valign="top" bordercolor="#000000"><strong>Button3</strong></td>
</tr>
<tr>
<td width="132" valign="top" bordercolor="#000000">Name</td>
<td width="216" valign="top" bordercolor="#000000">btnMultiply</td>
</tr>
<tr>
<td width="132" valign="top" bordercolor="#000000">Text</td>
<td width="216" valign="top" bordercolor="#000000">x</td>
</tr>
<tr bgcolor="#cccccc">
<td colspan="2" valign="top" bordercolor="#000000"><strong>Button4</strong></td>
</tr>
<tr>
<td width="132" valign="top" bordercolor="#000000">Name</td>
<td width="216" valign="top" bordercolor="#000000">btnSubtract</td>
</tr>
<tr>
<td width="132" valign="top" bordercolor="#000000">Text</td>
<td width="216" valign="top" bordercolor="#000000">/</td>
</tr>
<tr bgcolor="#cccccc">
<td colspan="2" valign="top" bordercolor="#000000"><strong>Label1</strong></td>
</tr>
<tr>
<td width="132" valign="top" bordercolor="#000000">Name</td>
<td width="216" valign="top" bordercolor="#000000">lblResult</td>
</tr>
<tr bgcolor="#cccccc">
<td colspan="2" valign="top" bordercolor="#000000"><strong>GroupBox1</strong></td>
</tr>
<tr>
<td width="132" valign="top" bordercolor="#000000">Text</td>
<td width="216" valign="top" bordercolor="#000000">MiniCalc</td>
</tr>
</tbody>
</table>
<p>4)Â Â Â  Right-click on the form and select View Code. You will see the following lines of code in the editor:</p>
<pre class="brush: vb.net">
Public Class miniCalc

End Class</pre>
<p>5)Â Â Â  Edit the code to make it as follows:</p>
<pre class="brush: vb.net">
Public Class miniCalc
Private Sub btnPlus_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnPlus.Click
lblResult.Text = CInt(txtValue1.Text) + CInt(txtValue2.Text)
End Sub

Private Sub btnMinus_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnMinus.Click
lblResult.Text = CInt(txtValue1.Text) - CInt(txtValue2.Text)
End Sub

Private Sub btnMultiply_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnMultiply.Click
lblResult.Text = CInt(txtValue1.Text) * CInt(txtValue2.Text)
End Sub

Private Sub btnDivide_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnDivide.Click
lblResult.Text = CInt(txtValue1.Text) / CInt(txtValue2.Text)
End Sub

Private Sub GroupBox1_Enter(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles GroupBox1.Enter
lblResult.Text = &quot;&quot;
End Sub
End Class
</pre>
<p>6)Â Â Â  In the solution explorer right-click on MiniCalc and select Properties:</p>
<p><a href="http://www.bahramov.com/images/articles/vb/1/04.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><span style="font-size: 12pt; font-family: Verdana;" lang="EN-GB"><img src="../../images/articles/vb/1/04.png" alt="" /></span></a></p>
<p>7)Â Â Â  Make sure that the following parameters are set:</p>
<p><a href="http://www.bahramov.com/images/articles/vb/1/05.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><span style="font-size: 12pt; font-family: Verdana;" lang="EN-GB"><img src="../../images/articles/vb/1/05.png" alt="" /></span></a></p>
<p>8)Â Â Â  Now go to Buildâ†’ Build MiniCalc</p>
<p><a href="http://www.bahramov.com/images/articles/vb/1/06.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><span style="font-size: 12pt; font-family: Verdana;" lang="EN-GB"><img src="../../images/articles/vb/1/06.png" alt="" /></span></a></p>
<p>9)Â Â Â  Now, go to the Bin folder in your project folder. In my case, I saved my MiniCalc project under C:\Projects\:</p>
<p><a href="http://www.bahramov.com/images/articles/vb/1/07.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><span style="font-size: 12pt; font-family: Verdana;" lang="EN-GB"><img src="../../images/articles/vb/1/07.png" alt="" /></span></a></p>
<p>10)Â Â Â  Copy the MiniCalc.dll to any other directory where you want to store your final DLLs. Itâ€™s always a good idea to keep your DLL project in case if you will need to modify it in the future. In my case I will copy MiniCalc.dll under C:\My DLLs\ folder.</p>
<p>11)Â Â Â  Close MiniCalc project.</p>
<p>12)Â Â Â  Create a new Windows Forms Application project and name it â€œMini Calculatorâ€</p>
<p><a href="http://www.bahramov.com/images/articles/vb/1/08.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><span style="font-size: 12pt; font-family: Verdana;" lang="EN-GB"><img src="../../images/articles/vb/1/08.png" alt="" width="477" height="328" /></span></a></p>
<p>13)Â Â Â  Go to Project and click on Add Referenceâ€¦</p>
<p><a href="http://www.bahramov.com/images/articles/vb/1/09.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><span style="font-size: 12pt; font-family: Verdana;" lang="EN-GB"><img src="../../images/articles/vb/1/09.png" alt="" width="266" height="289" /></span></a></p>
<p>14)Â Â Â  In the Add Reference window click on the Browse tab, locate MiniCalc.dll file and click OK button:</p>
<p><a href="http://www.bahramov.com/images/articles/vb/1/10.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><span style="font-size: 12pt; font-family: Verdana;" lang="EN-GB"><img src="../../images/articles/vb/1/10.png" alt="" width="342" height="274" /></span></a></p>
<p>15)Â Â Â  In the Toolbox pane right-click somewhere in the empty space and select Add Tab:</p>
<p><a href="http://www.bahramov.com/images/articles/vb/1/11.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><span style="font-size: 12pt; font-family: Verdana;" lang="EN-GB"><img src="../../images/articles/vb/1/11.png" alt="" width="203" height="248" /></span></a></p>
<p>16)Â Â Â  Name it My Controls and click Enter</p>
<p><a href="http://www.bahramov.com/images/articles/vb/1/12.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><span style="font-size: 12pt; font-family: Verdana;" lang="EN-GB"><img src="../../images/articles/vb/1/12.png" alt="" width="218" height="124" /></span></a></p>
<p>17)Â Â Â  Right-click under My Controls and select Choose Itemsâ€¦ from the context menus:</p>
<p><a href="http://www.bahramov.com/images/articles/vb/1/13.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><span style="font-size: 12pt; font-family: Verdana;" lang="EN-GB"><img src="../../images/articles/vb/1/13.png" alt="" /></span></a></p>
<p>18)Â Â Â  In the .NET Framework Components tab click Browse.. and locate MiniCalc.dll file.</p>
<p><a href="http://www.bahramov.com/images/articles/vb/1/14.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><span style="font-size: 12pt; font-family: Verdana;" lang="EN-GB"><img src="../../images/articles/vb/1/14.png" alt="" width="399" height="282" /></span></a></p>
<p>19)Â Â Â  miniCalc.dll will be added to your components collection. Click OK button to close the dialog window.</p>
<p><a href="http://www.bahramov.com/images/articles/vb/1/15.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><span style="font-size: 12pt; font-family: Verdana;" lang="EN-GB"><img src="../../images/articles/vb/1/15.png" alt="" width="399" height="283" /></span></a></p>
<p>20)Â Â Â  MiniCalc control is now added to My Controls.</p>
<p><a href="http://www.bahramov.com/images/articles/vb/1/16.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><span style="font-size: 12pt; font-family: Verdana;" lang="EN-GB"><img src="../../images/articles/vb/1/16.png" alt="" /></span></a></p>
<p>21)Â Â Â  Drag it to your form:</p>
<p><a href="http://www.bahramov.com/images/articles/vb/1/17.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><span style="font-size: 12pt; font-family: Verdana;" lang="EN-GB"><img src="../../images/articles/vb/1/17.png" alt="" /></span></a></p>
<p>22)Â Â Â  Click F5 to start debugging:</p>
<p><a href="http://www.bahramov.com/images/articles/vb/1/18.png#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed"><span style="font-size: 12pt; font-family: Verdana;" lang="EN-GB"><img src="../../images/articles/vb/1/18.png" alt="" /></span></a></p>
<p>In this tutorial we have learned how to create DLL files and use them across other applications.</p>
<p>Download the sample project <a href="http://www.bahramov.com/images/articles/vb/1/MiniCalcSource.zip#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bahramov.com/2009/03/18/vbnet-tutorial-creating-a-custom-dll-dynamic-link-library-in-visual-basic-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

