<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6791870946875982051</id><updated>2024-10-04T19:10:15.524-07:00</updated><title type='text'>Visual C++ Technical</title><subtitle type='html'>From this Visual C++ Technical blog you can find the procedure to create and implement the applications using C++, Visual C++, MFC, COM, C# and etc… </subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://visualcppcsharp.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6791870946875982051/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://visualcppcsharp.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>SivaPrasad Tamatam</name><uri>http://www.blogger.com/profile/12727559874417657768</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNpd5IMwFYlCwt_GEiZPR95W9BNPWSjieGfKZ-P-BsUW3sp1eAM9R_FkvhhQ31GSiluS3vpLCMX50gaFDl1NoyHr7wAxTImGmpyFmbriMFz2bxLruYAaiInfpbN2ls1A/s220/SivaTeja.bmp'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>2</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6791870946875982051.post-8874308691925723870</id><published>2013-07-13T09:45:00.002-07:00</published><updated>2013-07-13T09:54:40.464-07:00</updated><title type='text'>Dynamic Link Library..!</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: center;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;Dynamic
Link Library&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; line-height: 15.75pt; margin-bottom: 10.5pt; text-align: left;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;font-weight: normal;&quot;&gt; A dynamic-link library
(DLL) is an executable file that acts as a common store of functions. Dynamic
linking provides a way for a process to call a function that is not part of its
executable code. The executable code for the function is located in a DLL,
which contains one or more functions that are compiled, linked, and stored
separately from the processes that use them. DLLs also facilitate the sharing
of data and resources. Multiple applications can simultaneously access the
contents of a single copy of a DLL in memory.&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; line-height: 15.75pt; margin-bottom: 10.5pt; text-align: left; text-indent: 0.5in;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small; font-weight: normal;&quot;&gt;Dynamic linking differs from static linking in that it allows an
executable module (either a .dll or .exe file) to include only the information
needed at run time to locate the executable code for a DLL function. In static
linking, the linker gets all of the referenced functions from the static link
library and places it with your code into your executable.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; line-height: 15.75pt; margin-bottom: 10.5pt; text-align: left; text-indent: 0.5in;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Using dynamic linking instead of static linking offers several
advantages. DLLs save memory, reduce swapping, save disk space, upgrade easier,
provide after-market support, provide a mechanism to extend the MFC library
classes, support multilanguage programs, and ease the creation of international
versions.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: white; margin-bottom: 7.5pt; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;Create a dynamic link library (DLL) :&lt;/span&gt;&lt;b&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;subSection&quot; style=&quot;background-color: white; font-size: 14px; font-weight: normal; line-height: 18px; text-align: start;&quot;&gt;
&lt;ol style=&quot;line-height: 21px; margin-bottom: 14px;&quot;&gt;
&lt;li&gt;&lt;div style=&quot;margin-bottom: 14px; padding-bottom: 0px;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small; font-weight: normal;&quot;&gt;On the menu bar, choose&amp;nbsp;&lt;span class=&quot;label&quot;&gt;File&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;label&quot;&gt;New&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;label&quot;&gt;Project&lt;/span&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;margin-bottom: 14px; padding-bottom: 0px;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small; font-weight: normal;&quot;&gt;In the left pane of the&amp;nbsp;&lt;span class=&quot;label&quot;&gt;New Project&lt;/span&gt;&amp;nbsp;dialog box, expand&amp;nbsp;&lt;span class=&quot;label&quot;&gt;Installed&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;label&quot;&gt;Templates&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;label&quot;&gt;Visual C++&lt;/span&gt;, and then select&amp;nbsp;&lt;span class=&quot;label&quot;&gt;Win32&lt;/span&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;margin-bottom: 14px; padding-bottom: 0px;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small; font-weight: normal;&quot;&gt;In the center pane, select&amp;nbsp;&lt;span class=&quot;label&quot;&gt;Win32 Console Application&lt;/span&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;margin-bottom: 14px; padding-bottom: 0px;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small; font-weight: normal;&quot;&gt;Specify a name for the project—for example,&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;MathFuncsDll&lt;/span&gt;—in the&amp;nbsp;&lt;span class=&quot;label&quot;&gt;Name&lt;/span&gt;&amp;nbsp;box. Specify a name for the solution—for example,&amp;nbsp;&lt;span class=&quot;input&quot; style=&quot;font-weight: 700;&quot;&gt;DynamicLibrary&lt;/span&gt;—in the&amp;nbsp;&lt;span class=&quot;label&quot;&gt;Solution name&lt;/span&gt;&amp;nbsp;box. Choose the&amp;nbsp;&lt;span class=&quot;label&quot;&gt;OK&lt;/span&gt;&amp;nbsp;button.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;margin-bottom: 14px; padding-bottom: 0px;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small; font-weight: normal;&quot;&gt;On the&amp;nbsp;&lt;span class=&quot;label&quot;&gt;Overview&lt;/span&gt;&amp;nbsp;page of the&amp;nbsp;&lt;span class=&quot;label&quot;&gt;Win32 Application Wizard&lt;/span&gt;&amp;nbsp;dialog box, choose the&amp;nbsp;&lt;span class=&quot;label&quot;&gt;Next&lt;/span&gt;&amp;nbsp;button.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;margin-bottom: 14px; padding-bottom: 0px;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small; font-weight: normal;&quot;&gt;On the&amp;nbsp;&lt;span class=&quot;label&quot;&gt;Application Settings&lt;/span&gt;&amp;nbsp;page, under&amp;nbsp;&lt;span class=&quot;label&quot;&gt;Application type&lt;/span&gt;, select&amp;nbsp;&lt;span class=&quot;label&quot;&gt;DLL&lt;/span&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;div style=&quot;margin-bottom: 14px; padding-bottom: 0px;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small; font-weight: normal;&quot;&gt;Choose the&amp;nbsp;&lt;span class=&quot;label&quot;&gt;Finish&lt;/span&gt;&amp;nbsp;button to create the project.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/h2&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;To add a class to the dynamic link library&lt;br /&gt;&lt;span style=&quot;color: green;&quot;&gt;// MathFuncsDll.h&lt;/span&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;ifdef MATHFUNCSDLL_EXPORTS
&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;ifdef MATHFUNCSDLL_EXPORTS&lt;br /&gt;##define MATHFUNCSDLL_API __declspec(&lt;span style=&quot;color: blue;&quot;&gt;dllexport&lt;/span&gt;) &lt;br /&gt;#&lt;span style=&quot;color: blue;&quot;&gt;else&lt;/span&gt;&lt;br /&gt;#define MATHFUNCSDLL_API __declspec(&lt;span style=&quot;color: blue;&quot;&gt;dllimport&lt;/span&gt;) &lt;br /&gt;#endif&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; MathFuncs&lt;br /&gt;{&lt;br /&gt;  &lt;span style=&quot;color: green;&quot;&gt;// This class is exported from the MathFuncsDll.dll&lt;/span&gt;  &lt;br /&gt;   &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; MyMathFuncs&lt;br /&gt;     {&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;:     &lt;br /&gt;       &lt;span style=&quot;color: green;&quot;&gt;// Returns a + b&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt; MATHFUNCSDLL_API &lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; Add(&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; a, &lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; b); &lt;br /&gt; 
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;// Returns a - b&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;
&lt;span style=&quot;color: green;&quot;&gt;/&lt;/span&gt;&lt;br /&gt;       &lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt; MATHFUNCSDLL_API &lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; Subtract(&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; a, &lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; b); &lt;br /&gt; 
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;// Returns a * b&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;
&lt;br /&gt;       &lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt; MATHFUNCSDLL_API &lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; Multiply(&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; a, &lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; b); &lt;br /&gt; 
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;// Returns a / b&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;
&lt;br /&gt;       &lt;span style=&quot;color: green;&quot;&gt;// Throws const std::invalid_argument&amp;amp; if b is 0&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt; MATHFUNCSDLL_API &lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; Divide(&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; a, &lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; b); &lt;br /&gt;    };&lt;br /&gt; }&lt;br /&gt;&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;/ MathFuncsDll.cpp : Defines the exported functions for the DLL application.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: green;&quot;&gt;//&lt;/span&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
include &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;stdafx.h&quot;&lt;/span&gt;&lt;/div&gt;
include &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;stdafx.h&quot;&lt;/span&gt;&lt;br /&gt;#&lt;br /&gt;include &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;MathFuncsDll.h&quot;&lt;/span&gt;&lt;br /&gt;#&lt;br /&gt;include &amp;lt;stdexcept&amp;gt;&lt;br /&gt;#&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; std;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; MathFuncs&lt;/div&gt;
&lt;br /&gt;{&lt;br /&gt;  &lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; MyMathFuncs::Add(&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; a, &lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; b)  &lt;br /&gt;   {&lt;br /&gt;         &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; a + b;&lt;br /&gt;    }
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; MyMathFuncs::Subtract(&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; a, &lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; b)    &lt;br /&gt;   {&lt;br /&gt;         &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; a - b;&lt;br /&gt;    }
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; MyMathFuncs::Multiply(&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; a, &lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; b)    &lt;br /&gt;   {&lt;br /&gt;         &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; a * b;&lt;br /&gt;    }
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; MyMathFuncs::Divide(&lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; a, &lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; b)    &lt;br /&gt;   {&lt;br /&gt;         &lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (b == 0)&lt;br /&gt;        {&lt;br /&gt;  &lt;span style=&quot;color: blue;&quot;&gt;throw&lt;/span&gt; invalid_argument(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;b cannot be zero!&quot;&lt;/span&gt;);          &lt;br /&gt;       }&lt;br /&gt;       &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; a / b;  &lt;br /&gt;    }&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;To create an app that references the DLL&lt;br /&gt;To use the functionality from the class library in the app&lt;br /&gt;&lt;span style=&quot;color: green;&quot;&gt;// MyExecRefsDll.cpp&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: green;&quot;&gt;// compile with: /EHsc /link MathFuncsDll.lib&lt;/span&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;include &amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;
#include &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;MathFuncsDll.h&quot;&lt;/span&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; std;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;
&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; main()&lt;br /&gt;{&lt;br /&gt;  &lt;span style=&quot;color: blue;&quot;&gt;double&lt;/span&gt; a = 7.4;  &lt;br /&gt;   &lt;span style=&quot;color: blue;&quot;&gt;int&lt;/span&gt; b = 99;&lt;br /&gt; 
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif; font-size: x-small;&quot;&gt;
cout &amp;lt;&amp;lt; &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;a + b = &quot;&lt;/span&gt; &amp;lt;&amp;lt;  &lt;br /&gt;       MathFuncs::MyMathFuncs::Add(a, b) &amp;lt;&amp;lt; endl;&lt;br /&gt;     cout &amp;lt;&amp;lt; &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;a - b = &quot;&lt;/span&gt; &amp;lt;&amp;lt;&lt;br /&gt;        MathFuncs::MyMathFuncs::Subtract(a, b) &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;a * b = &quot;&lt;/span&gt; &amp;lt;&amp;lt;&lt;br /&gt;        MathFuncs::MyMathFuncs::Multiply(a, b) &amp;lt;&amp;lt; endl;&lt;br /&gt;    cout &amp;lt;&amp;lt; &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;a / b = &quot;&lt;/span&gt; &amp;lt;&amp;lt;&lt;br /&gt;        MathFuncs::MyMathFuncs::Divide(a, b) &amp;lt;&amp;lt; endl;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;try&lt;/span&gt;&lt;br /&gt;    {&lt;br /&gt;         cout &amp;lt;&amp;lt; &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;a / 0 = &quot;&lt;/span&gt; &amp;lt;&amp;lt;&lt;br /&gt;            MathFuncs::MyMathFuncs::Divide(a, 0) &amp;lt;&amp;lt; endl; &lt;br /&gt;    }&lt;br /&gt;&lt;span style=&quot;color: blue;&quot;&gt;catch&lt;/span&gt; (&lt;span style=&quot;color: blue;&quot;&gt;const&lt;/span&gt; invalid_argument &amp;amp;e)     &lt;br /&gt;    {&lt;br /&gt; cout &amp;lt;&amp;lt; &lt;span style=&quot;color: #a31515;&quot;&gt;&quot;Caught exception: &quot;&lt;/span&gt; &amp;lt;&amp;lt; e.what() &amp;lt;&amp;lt; endl;        &lt;br /&gt;    }
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; 0;    
&lt;br /&gt;}&lt;br /&gt;To run the application&lt;br /&gt;a + b = 106.4&lt;br /&gt;a - b = -91.6&lt;br /&gt;a / b = 0.074&lt;br /&gt;a * b = 732.6&lt;br /&gt;7475&lt;br /&gt; cannot be zero!&lt;br /&gt;Caught exception: &lt;br /&gt;b&lt;br /&gt;&lt;b&gt;Reference : &lt;/b&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/vstudio/ms235636.aspx&quot; style=&quot;font-weight: bold;&quot;&gt;http://msdn.microsoft.com/en-us/library/vstudio/ms235636.aspx&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://visualcppcsharp.blogspot.com/feeds/8874308691925723870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://visualcppcsharp.blogspot.com/2013/07/dynamic-link-library.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6791870946875982051/posts/default/8874308691925723870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6791870946875982051/posts/default/8874308691925723870'/><link rel='alternate' type='text/html' href='http://visualcppcsharp.blogspot.com/2013/07/dynamic-link-library.html' title='Dynamic Link Library..!'/><author><name>SivaPrasad Tamatam</name><uri>http://www.blogger.com/profile/12727559874417657768</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNpd5IMwFYlCwt_GEiZPR95W9BNPWSjieGfKZ-P-BsUW3sp1eAM9R_FkvhhQ31GSiluS3vpLCMX50gaFDl1NoyHr7wAxTImGmpyFmbriMFz2bxLruYAaiInfpbN2ls1A/s220/SivaTeja.bmp'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6791870946875982051.post-5620792438841033544</id><published>2012-10-05T12:05:00.002-07:00</published><updated>2012-10-06T07:41:54.794-07:00</updated><title type='text'></title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2 style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;Create a Static Library using Visual C++&lt;/span&gt;&lt;/h2&gt;
&lt;div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif; line-height: 115%;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;Procedure to develop, implement Static Library and
procedure to use a static library in the Visual C++ MFC application.&lt;/span&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif; line-height: 115%;&quot;&gt;&lt;span style=&quot;color: #351c75;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;b&gt;Please download source code from below link:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;line-height: 115%;&quot;&gt;&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; line-height: 115%;&quot;&gt;&lt;a href=&quot;https://sites.google.com/site/staticlibsample/system/app/pages/admin/attachments&quot;&gt;&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;b&gt;https://sites.google.com/site/staticlibsample/system/app/pages/admin/attachments&lt;/b&gt;&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Trebuchet MS&amp;quot;,&amp;quot;sans-serif&amp;quot;; font-size: 10.0pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;Step 1: Run Visual Studio 2008 Application&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;Step 2: File-&amp;gt;New-&amp;gt;Project&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1bBeZw9pGXHRRPTJJnauOyJ2TTq4fRkEmNsKUqd6wimZ7fzALrZCfP41E2apv4-u4Th3AQ20jriAbALtbncSFtBKakdKtn72Mnv8M5fUBcUqL1aBKlvIAUHHXRMUmdfevpkezRoNVtzI4/s1600/StaticLib1.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;220&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1bBeZw9pGXHRRPTJJnauOyJ2TTq4fRkEmNsKUqd6wimZ7fzALrZCfP41E2apv4-u4Th3AQ20jriAbALtbncSFtBKakdKtn72Mnv8M5fUBcUqL1aBKlvIAUHHXRMUmdfevpkezRoNVtzI4/s320/StaticLib1.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;Step 3: Now Please add the Static Lib name and click on Ok button you can see below screen&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJMfgphI_f7NiccpWJkbfFEKdVX8Vxt3YScJhTS1DJjQzLYpmtZDHeFwNM_tb5Dey3ILEJBkTOld3IXnTwIboVvfU8uoWrR3Ufk3Gg-J3Jp-tro-RluOHFMDecSVVLVYOr_V5bxJJUg43A/s1600/Staticlib2.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;272&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJMfgphI_f7NiccpWJkbfFEKdVX8Vxt3YScJhTS1DJjQzLYpmtZDHeFwNM_tb5Dey3ILEJBkTOld3IXnTwIboVvfU8uoWrR3Ufk3Gg-J3Jp-tro-RluOHFMDecSVVLVYOr_V5bxJJUg43A/s320/Staticlib2.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;Step 4: Select Static Library radio button click on Finish button. Empty project will be created as below:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiblYh_nieOy_ZkNDKpdd_SxIY8OyqYv02wz0FxxPJ4ZABqEE_88M0F2djPhWDfQoQ5S7cFaiZk9olkm66_Sq0JCb0zdVXEDorekBxIsEXzx8Wiq68cTiJ2UCx9WKmENu6eRw1b7hj4vA4/s1600/Staticlib3.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;234&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgiblYh_nieOy_ZkNDKpdd_SxIY8OyqYv02wz0FxxPJ4ZABqEE_88M0F2djPhWDfQoQ5S7cFaiZk9olkm66_Sq0JCb0zdVXEDorekBxIsEXzx8Wiq68cTiJ2UCx9WKmENu6eRw1b7hj4vA4/s320/Staticlib3.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;Step 5: Now add the&amp;nbsp;staticlib.h and&amp;nbsp;staticlib.cpp files and please write your own functions prototypes&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;in&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #674ea7; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;staticlib.h:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;int Add(int iFirst,int iSecond);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;int Subtract(int iFirst,int iSecond);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Step 6: Please implement the declared functions in&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: #674ea7; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;staticlib.cpp:&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;#include &quot;stdafx.h&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;#include &quot;staticlib.h&quot;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;int Add(int iFirst,int iSecond)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;return (iFirst+iSecond);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;int Subtract(int iFirst,int iSecond)&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;return (iFirst-iSecond);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #674ea7;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #674ea7;&quot;&gt;&lt;span style=&quot;font-family: Trebuchet MS, sans-serif;&quot;&gt;Step 7: Now build the application your Static lib will be ready at application path in release or debug folder depending on build settings.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnRTeiJSyZRYN1QVviofvsQ1u1_3NSRgh-Fj5a9J7FoO56aFSMSx42kSE3CCHTgiJILG2BG2URXVmUEmoppU_qsZuTBBzj2Dp276lirCPRXfE1e274X4iuWmdXR3mk1fvBz8AlbUUt1A9G/s1600/Staticlib4.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;104&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnRTeiJSyZRYN1QVviofvsQ1u1_3NSRgh-Fj5a9J7FoO56aFSMSx42kSE3CCHTgiJILG2BG2URXVmUEmoppU_qsZuTBBzj2Dp276lirCPRXfE1e274X4iuWmdXR3mk1fvBz8AlbUUt1A9G/s320/Staticlib4.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;Now static library is ready. now how to test this library..?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif; font-size: large;&quot;&gt;&lt;b&gt;Use Static Library in the Application&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif; font-size: large;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;margin-bottom: .0001pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;Step
1: Right click on Solution &quot;StaticLib&quot; and add new MFC Dialog based Application with
name MathsApp&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguIE-P7naE4hmAXfQkU1Nro9jFsM2MFubwlSlXnxq-CrarFcCNumeEIFlOZBy8b5S2eZMYk9_pLW-gNvQSdvkkCHUSSamt_ItCEwdl8AhHEs3L6yYlMUN3k3p3-baKrg0SOo2hlGpZBboK/s1600/Staticlib5.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;172&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguIE-P7naE4hmAXfQkU1Nro9jFsM2MFubwlSlXnxq-CrarFcCNumeEIFlOZBy8b5S2eZMYk9_pLW-gNvQSdvkkCHUSSamt_ItCEwdl8AhHEs3L6yYlMUN3k3p3-baKrg0SOo2hlGpZBboK/s320/Staticlib5.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjct9Yu5enM7UfmLAO373yTVCjM_xdV6eqJPBi4GMiW9YlIfD8sr_JpG4QjMxLjJVzAzdgk5IIlX03BnyIxK4UYzyZP0sqi-u3-Mk69-g_SxPRYpSDIvVdRqDP3FrRi1uOkwc0xiLMPBs7z/s1600/Staticlib6.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;209&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjct9Yu5enM7UfmLAO373yTVCjM_xdV6eqJPBi4GMiW9YlIfD8sr_JpG4QjMxLjJVzAzdgk5IIlX03BnyIxK4UYzyZP0sqi-u3-Mk69-g_SxPRYpSDIvVdRqDP3FrRi1uOkwc0xiLMPBs7z/s320/Staticlib6.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;Step 2: After Project name is entered click on Ok button and your can see the below dialog from which please select Dialog Based &amp;nbsp;and click on finish.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHhzxt7uG9y_AbP9PJnDNT9fhdnICud_HL9wnOEWMIsDLNenLU6UHQLqBML0anxqlcIK1_AJ2D8U_J_h2weOCYGaD7oIfEjYJBG3d4CTqdsM0YDWH4dsgaHWpXi0t17RgMOOOM-lGtkp4t/s1600/Staticlib7.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;272&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiHhzxt7uG9y_AbP9PJnDNT9fhdnICud_HL9wnOEWMIsDLNenLU6UHQLqBML0anxqlcIK1_AJ2D8U_J_h2weOCYGaD7oIfEjYJBG3d4CTqdsM0YDWH4dsgaHWpXi0t17RgMOOOM-lGtkp4t/s320/Staticlib7.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;Step 3: Now in the dialog please add labels and text boxes as &amp;nbsp;shown below screen shot&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXhtStHGuNWhQmNZLkn0_OhgVnQD6yvzvJerEtYAqe6ih5arvWQIMxf8xBbapu4nugWE4c0iKhXFchBkv6EENo10t6H_94Dp7xLPVcaq7MQSS4RnvRSVP60vTVZObEgVZD05D_NS0OGTfo/s1600/Staticlib8.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjXhtStHGuNWhQmNZLkn0_OhgVnQD6yvzvJerEtYAqe6ih5arvWQIMxf8xBbapu4nugWE4c0iKhXFchBkv6EENo10t6H_94Dp7xLPVcaq7MQSS4RnvRSVP60vTVZObEgVZD05D_NS0OGTfo/s320/Staticlib8.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;Step 4: Please write below code in the Add button click event handler. Please see the &lt;b&gt;ADD &lt;/b&gt;function of static lib is called.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;void CMathsAppDlg::OnBnClickedAdd()&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;// TODO: Add your control notification handler code here&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;CString strInputA = _T(&quot;&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;CString strInputB = _T(&quot;&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;CString strResult = _T(&quot;&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;CEdit* pEdit = NULL;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;int iInputA =0x00;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;int iInputB =0x00;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;int iResult =0x00;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;pEdit = (CEdit*)GetDlgItem(IDC_EDT_INPUT_A);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;pEdit-&amp;gt;GetWindowTextW(strInputA);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;pEdit = (CEdit*)GetDlgItem(IDC_EDT_INPUT_B);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;pEdit-&amp;gt;GetWindowTextW(strInputB);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;iInputA = (int)_tcstol(strInputA,0,10);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;iInputB = (int)_tcstol(strInputB,0,10);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;b&gt;iResult = Add(iInputA,iInputB);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;strResult.Format(_T(&quot;%d&quot;),iResult);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;pEdit = (CEdit*)GetDlgItem(IDC_EDT_RESULT);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;pEdit-&amp;gt;SetWindowText(strResult);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;Step 5: Please write below code in the Subtract button click event handler.P&lt;/span&gt;&lt;span style=&quot;color: #351c75; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;lease see the&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;color: #351c75; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Subtract&amp;nbsp;&lt;/b&gt;&lt;span style=&quot;color: #351c75; font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;function of static lib is called&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;void CMathsAppDlg::OnBnClickedSubract()&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;// TODO: Add your control notification handler code here&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;CString strInputA = _T(&quot;&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;CString strInputB = _T(&quot;&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;CString strResult = _T(&quot;&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;CEdit* pEdit = NULL;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;int iInputA =0x00;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;int iInputB =0x00;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;int iResult =0x00;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;pEdit = (CEdit*)GetDlgItem(IDC_EDT_INPUT_A);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;pEdit-&amp;gt;GetWindowTextW(strInputA);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;pEdit = (CEdit*)GetDlgItem(IDC_EDT_INPUT_B);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;pEdit-&amp;gt;GetWindowTextW(strInputB);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;iInputA = (int)_tcstol(strInputA,0,10);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;iInputB = (int)_tcstol(strInputB,0,10);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;b&gt;iResult = Subtract(iInputA,iInputB);&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;strResult.Format(_T(&quot;%d&quot;),iResult);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;pEdit = (CEdit*)GetDlgItem(IDC_EDT_RESULT);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;pEdit-&amp;gt;SetWindowText(strResult);&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;Step 6:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;now if you compile you will get below errors&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: red; font-family: Trebuchet MS, sans-serif;&quot;&gt;Error&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;1&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;error C3861: &#39;Add&#39;: identifier not found&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;e:\samples\staticlib\mathsapp\mathsappdlg.cpp&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;176&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;MathsApp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;color: red; font-family: Trebuchet MS, sans-serif;&quot;&gt;Error&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;2&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;error C3861: &#39;Subtract&#39;: identifier not found&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;e:\samples\staticlib\mathsapp\mathsappdlg.cpp&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;207&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;MathsApp&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;Please do the below settings to compile application successfully:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&amp;nbsp;a. Please include the header path on top of the cpp file&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt; #include &quot;staticlib.h&quot;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;b. Please set the header path as below screen shot&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh22DVf4NBcrnmhjRKOqgM4eQ_nxm-qPbiPbFJvLDeGaqmx5l1pMZvoqV10u6Yd8y-BlkL2ud5dhLQr35xIFlcfiLT5XRA3yNWyJgVg4woxsKf0GQJfqraHbYNiDtg_YkdVtK_hkbmGKb0r/s1600/Staticlib9.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;240&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh22DVf4NBcrnmhjRKOqgM4eQ_nxm-qPbiPbFJvLDeGaqmx5l1pMZvoqV10u6Yd8y-BlkL2ud5dhLQr35xIFlcfiLT5XRA3yNWyJgVg4woxsKf0GQJfqraHbYNiDtg_YkdVtK_hkbmGKb0r/s320/Staticlib9.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif; font-size: large;&quot;&gt;c. In the linker settings please do the below settings to run and call static lib functions&amp;nbsp;successfully&amp;nbsp;from application.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif; font-size: large;&quot;&gt;Set the Library directory path:&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLy5YBBzigBV5VeXG6vlNPHi_A9rW8npB6jAR2z7AUW1hpROkIcEaW-Aqn5hXXU4dr7nwqSNSK3f6XdC6oiVzgAb5I-KK7Fwf83ILOV2HJt7vyRI820kVfXKDM2wrs8vjkVAxwMU1dp_Wc/s1600/Staticlib10.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;222&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLy5YBBzigBV5VeXG6vlNPHi_A9rW8npB6jAR2z7AUW1hpROkIcEaW-Aqn5hXXU4dr7nwqSNSK3f6XdC6oiVzgAb5I-KK7Fwf83ILOV2HJt7vyRI820kVfXKDM2wrs8vjkVAxwMU1dp_Wc/s320/Staticlib10.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;In Input settings add staticlib.lib as shown below screen shot&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXe54QYErDVjQopDngxBDVV3yQXjtNudgU0VMS8ZPstmByH-mIWG-rSaFf3iNX_RP9jAAAH0MciaZ-O0eNjZ9xain2FhCOhYrHgi08suhZ8nInpGl9De4MmYlyWVkmelkjCBg4a5OmwWTV/s1600/Staticlib11.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;222&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhXe54QYErDVjQopDngxBDVV3yQXjtNudgU0VMS8ZPstmByH-mIWG-rSaFf3iNX_RP9jAAAH0MciaZ-O0eNjZ9xain2FhCOhYrHgi08suhZ8nInpGl9De4MmYlyWVkmelkjCBg4a5OmwWTV/s320/Staticlib11.bmp&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;Now run the application and test the static lib functions and the Add function out put screen :&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxrdemZpbgU76R5bDmidOVMuFqMOdYBs1UTGiwI22u7WBJsLxv1YjJNoewUrIQCqFp_u5b7onGsUVFr5yfq20CgoldVlgDPLWpUxrHmcnMIF7yXtxXhVc13xxeQaL3EVuSmEM_qZUc3XVO/s1600/Staticlib12.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxrdemZpbgU76R5bDmidOVMuFqMOdYBs1UTGiwI22u7WBJsLxv1YjJNoewUrIQCqFp_u5b7onGsUVFr5yfq20CgoldVlgDPLWpUxrHmcnMIF7yXtxXhVc13xxeQaL3EVuSmEM_qZUc3XVO/s1600/Staticlib12.bmp&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;Subtract function output screen :&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPKk9WaEC2BIlnrrBZkkcoHJB-L8E4QpxoMCiMiwlMnnEe-Q80z6pD6q5c-nRqxHGTbEmh-eDYtrVYams86DwcI0wZrTVXAjhukxWSQtshiRezAmaWb88sT3jn3q3FSugI4ZeweaL5mAJh/s1600/Staticlib13.bmp&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjPKk9WaEC2BIlnrrBZkkcoHJB-L8E4QpxoMCiMiwlMnnEe-Q80z6pD6q5c-nRqxHGTbEmh-eDYtrVYams86DwcI0wZrTVXAjhukxWSQtshiRezAmaWb88sT3jn3q3FSugI4ZeweaL5mAJh/s1600/Staticlib13.bmp&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;Now you have learned how implement a static library and how use the static library in the application.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;color: #674ea7; font-family: Trebuchet MS, sans-serif;&quot;&gt;Source code for above sample is available in the below link:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #351c75; font-family: Trebuchet MS, sans-serif;&quot;&gt;&lt;br /&gt;
&lt;a href=&quot;https://sites.google.com/site/staticlibsample/system/app/pages/admin/attachments&quot;&gt;https://sites.google.com/site/staticlibsample/system/app/pages/admin/attachments&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://visualcppcsharp.blogspot.com/feeds/5620792438841033544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://visualcppcsharp.blogspot.com/2012/10/create-static-library-using-visual-c.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6791870946875982051/posts/default/5620792438841033544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6791870946875982051/posts/default/5620792438841033544'/><link rel='alternate' type='text/html' href='http://visualcppcsharp.blogspot.com/2012/10/create-static-library-using-visual-c.html' title=''/><author><name>SivaPrasad Tamatam</name><uri>http://www.blogger.com/profile/12727559874417657768</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNpd5IMwFYlCwt_GEiZPR95W9BNPWSjieGfKZ-P-BsUW3sp1eAM9R_FkvhhQ31GSiluS3vpLCMX50gaFDl1NoyHr7wAxTImGmpyFmbriMFz2bxLruYAaiInfpbN2ls1A/s220/SivaTeja.bmp'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1bBeZw9pGXHRRPTJJnauOyJ2TTq4fRkEmNsKUqd6wimZ7fzALrZCfP41E2apv4-u4Th3AQ20jriAbALtbncSFtBKakdKtn72Mnv8M5fUBcUqL1aBKlvIAUHHXRMUmdfevpkezRoNVtzI4/s72-c/StaticLib1.bmp" height="72" width="72"/><thr:total>1</thr:total></entry></feed>