<?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: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-6168139672739372652</id><updated>2012-02-16T05:56:14.835-08:00</updated><title type='text'>Software Development using C# .Net</title><subtitle type='html'>C#.Net development techniques and sample code</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>36</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-5653970184754998551</id><published>2012-02-13T01:23:00.001-08:00</published><updated>2012-02-13T01:23:15.841-08:00</updated><title type='text'>Reminder about your invitation from Heidi (Zhaoling) Y.</title><content type='html'>&lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;" width="100%" bgcolor="#F4F4F4"&gt;&lt;tr&gt;&lt;td align="center"&gt;     &lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;" width="550"&gt;   &lt;tr&gt;&lt;td&gt;     &lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:10px;font-size:10px;line-height:10px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;   &lt;/td&gt;&lt;/tr&gt; &lt;/table&gt;  &lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;border:solid 1px #DDDDDD;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;" bgcolor="#FFFFFF" width="550"&gt;&lt;tr&gt;&lt;td colspan="3"&gt;&lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:15px;font-size:15px;line-height:15px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="1%"&gt;&lt;table width="15" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:0px;font-size:0px;line-height:0px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;td width="98%" valign="top" align=""&gt;   &lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;" width="100%"&gt;   &lt;tr&gt;     &lt;td align="left"&gt;       &lt;img src="http://www.linkedin.com/scds/common/u/img/logos/logo_emails_trans_98x24.png" alt="LinkedIn" border="0" height="24" width="98"&gt;     &lt;/td&gt;    &lt;/tr&gt;   &lt;tr&gt;&lt;td&gt;     &lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:10px;font-size:10px;line-height:10px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;   &lt;/td&gt;&lt;/tr&gt;   &lt;/table&gt;   &lt;div style="font-family:Arial,sans-serif;font-size:12px"&gt;This is a reminder that on February 1, Heidi (Zhaoling) Y. sent you an invitation to become part of their professional network at LinkedIn.&lt;/div&gt;   &lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;" width="100%"&gt;     &lt;tr&gt;&lt;td&gt;&lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:12px;font-size:12px;line-height:12px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;     &lt;tr&gt;&lt;td&gt;         &lt;table border="0" cellpadding="6" cellspacing="1" align=""&gt;&lt;tr&gt;&lt;td align="center" valign="middle" bgcolor="#FFE86C" background="http://www.linkedin.com/scds/common/u/img/bg/yellow_button_back.png" style="background:url(http://www.linkedin.com/scds/common/u/img/bg/yellow_button_back.png) repeat-x scroll 100% 0 #FFE86C;background-color:#FFE86C;border:1px solid #E8B463;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;"&gt;&lt;div style="padding-right:10px;padding-left:10px;"&gt;&lt;a href="https://www.linkedin.com/e/994lwf-gylapdu7-3x/doi/5753160993/2z28XEyM/gir_1627413146_1/?hs=false&amp;amp;tok=1AbnZTifCj0R81" style="text-decoration:none;"&gt;&lt;span style="font-size:12px;font-family:Arial;font-weight:bold;color:#333333;white-space:nowrap;display:block;"&gt;Accept Heidi (Zhaoling) Y.'s Invitation&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;     &lt;/td&gt;&lt;/tr&gt;     &lt;tr&gt;&lt;td&gt;&lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:12px;font-size:12px;line-height:12px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;   &lt;/table&gt;   &lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;" width="100%"&gt;&lt;tr&gt;&lt;td style="border:1px dotted #DDDDDD;border-width:1px 0"&gt;   &lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;background:#F2FAFF" width="100%"&gt;     &lt;tr&gt;&lt;td colspan="3"&gt;&lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:5px;font-size:5px;line-height:5px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;     &lt;tr&gt;       &lt;td&gt;&lt;table width="10" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:0px;font-size:0px;line-height:0px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;       &lt;td style="font-family:Arial,sans-serif;font-size:12px"&gt;                          &lt;div&gt;On February 1, Heidi (Zhaoling) Y. wrote:&lt;/div&gt;&lt;br&gt;               &lt;div&gt;&amp;gt; To:  [houzhip.csdev@blogger.com]&lt;/div&gt;               &lt;div&gt;&amp;gt; From: Heidi (Zhaoling) Y. [yaoz2004@gmail.com]&lt;/div&gt;                &lt;div&gt;&amp;gt; Subject: Invitation to connect on LinkedIn&lt;/div&gt;&lt;br&gt;               &gt; I'd like to add you to my professional network on LinkedIn.&lt;br/&gt; &gt; &lt;br/&gt; &gt; - Heidi (Zhaoling)                     &lt;/td&gt;       &lt;td&gt;&lt;table width="5" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:0px;font-size:0px;line-height:0px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;&lt;td colspan="3"&gt;&lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:5px;font-size:5px;line-height:5px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;   &lt;/table&gt;   &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; &lt;/td&gt;&lt;td width="1%"&gt;&lt;table width="15" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:0px;font-size:0px;line-height:0px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan="3"&gt;&lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:15px;font-size:15px;line-height:15px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; &lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:5px;font-size:5px;line-height:5px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; &lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;width:550px" &gt;   &lt;tr&gt;     &lt;td style="color:#999;font-family:Arial,sans-serif;font-size:11px;line-height:15px"&gt;       &lt;div&gt; You are receiving &lt;b style="color:#666"&gt;Reminder emails for pending invitations&lt;/b&gt;.         &lt;a href="http://www.linkedin.com/e/994lwf-gylapdu7-3x/dXTqxoLoR5UOl3VplPzvucCvX98ww9UdwwskCg7/goo/houzhip%2Ecsdev%40blogger%2Ecom/20060/I2002067724_1/?hs=false&amp;amp;tok=0RUbnFenqj0R81"&gt;Unsubscribe.&lt;/a&gt;       &lt;/div&gt;       &lt;div&gt;&amp;copy; 2012 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA.&lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:1px;font-size:1px;line-height:1px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;     &lt;/td&gt;   &lt;/tr&gt; &lt;/table&gt;       &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-5653970184754998551?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/5653970184754998551/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2012/02/reminder-about-your-invitation-from_13.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/5653970184754998551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/5653970184754998551'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2012/02/reminder-about-your-invitation-from_13.html' title='Reminder about your invitation from Heidi (Zhaoling) Y.'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-2307338717854222212</id><published>2012-02-06T05:15:00.001-08:00</published><updated>2012-02-06T05:15:29.260-08:00</updated><title type='text'>Reminder about your invitation from Heidi (Zhaoling) Y.</title><content type='html'>&lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;" width="100%" bgcolor="#F4F4F4"&gt;&lt;tr&gt;&lt;td align="center"&gt;     &lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;" width="550"&gt;   &lt;tr&gt;&lt;td&gt;     &lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:10px;font-size:10px;line-height:10px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;   &lt;/td&gt;&lt;/tr&gt; &lt;/table&gt;  &lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;border:solid 1px #DDDDDD;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;" bgcolor="#FFFFFF" width="550"&gt;&lt;tr&gt;&lt;td colspan="3"&gt;&lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:15px;font-size:15px;line-height:15px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="1%"&gt;&lt;table width="15" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:0px;font-size:0px;line-height:0px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;td width="98%" valign="top" align=""&gt;   &lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;" width="100%"&gt;   &lt;tr&gt;     &lt;td align="left"&gt;       &lt;img src="http://www.linkedin.com/scds/common/u/img/logos/logo_emails_trans_98x24.png" alt="LinkedIn" border="0" height="24" width="98"&gt;     &lt;/td&gt;    &lt;/tr&gt;   &lt;tr&gt;&lt;td&gt;     &lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:10px;font-size:10px;line-height:10px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;   &lt;/td&gt;&lt;/tr&gt;   &lt;/table&gt;   &lt;div style="font-family:Arial,sans-serif;font-size:12px"&gt;This is a reminder that on February 1, Heidi (Zhaoling) Y. sent you an invitation to become part of their professional network at LinkedIn.&lt;/div&gt;   &lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;" width="100%"&gt;     &lt;tr&gt;&lt;td&gt;&lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:12px;font-size:12px;line-height:12px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;     &lt;tr&gt;&lt;td&gt;         &lt;table border="0" cellpadding="6" cellspacing="1" align=""&gt;&lt;tr&gt;&lt;td align="center" valign="middle" bgcolor="#FFE86C" background="http://www.linkedin.com/scds/common/u/img/bg/yellow_button_back.png" style="background:url(http://www.linkedin.com/scds/common/u/img/bg/yellow_button_back.png) repeat-x scroll 100% 0 #FFE86C;background-color:#FFE86C;border:1px solid #E8B463;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;"&gt;&lt;div style="padding-right:10px;padding-left:10px;"&gt;&lt;a href="https://www.linkedin.com/e/994lwf-gybix25p-w/doi/5753160993/2z28XEyM/gir_1627413146_0/?hs=false&amp;amp;tok=0b-D-2mZErTl41" style="text-decoration:none;"&gt;&lt;span style="font-size:12px;font-family:Arial;font-weight:bold;color:#333333;white-space:nowrap;display:block;"&gt;Accept Heidi (Zhaoling) Y.'s Invitation&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;     &lt;/td&gt;&lt;/tr&gt;     &lt;tr&gt;&lt;td&gt;&lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:12px;font-size:12px;line-height:12px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;   &lt;/table&gt;   &lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;" width="100%"&gt;&lt;tr&gt;&lt;td style="border:1px dotted #DDDDDD;border-width:1px 0"&gt;   &lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;background:#F2FAFF" width="100%"&gt;     &lt;tr&gt;&lt;td colspan="3"&gt;&lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:5px;font-size:5px;line-height:5px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;     &lt;tr&gt;       &lt;td&gt;&lt;table width="10" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:0px;font-size:0px;line-height:0px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;       &lt;td style="font-family:Arial,sans-serif;font-size:12px"&gt;                          &lt;div&gt;On February 1, Heidi (Zhaoling) Y. wrote:&lt;/div&gt;&lt;br&gt;               &lt;div&gt;&amp;gt; To:  [houzhip.csdev@blogger.com]&lt;/div&gt;               &lt;div&gt;&amp;gt; From: Heidi (Zhaoling) Y. [yaoz2004@gmail.com]&lt;/div&gt;                &lt;div&gt;&amp;gt; Subject: Invitation to connect on LinkedIn&lt;/div&gt;&lt;br&gt;               &gt; I'd like to add you to my professional network on LinkedIn.&lt;br/&gt; &gt; &lt;br/&gt; &gt; - Heidi (Zhaoling)                     &lt;/td&gt;       &lt;td&gt;&lt;table width="5" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:0px;font-size:0px;line-height:0px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;&lt;td colspan="3"&gt;&lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:5px;font-size:5px;line-height:5px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;   &lt;/table&gt;   &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; &lt;/td&gt;&lt;td width="1%"&gt;&lt;table width="15" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:0px;font-size:0px;line-height:0px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan="3"&gt;&lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:15px;font-size:15px;line-height:15px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; &lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:5px;font-size:5px;line-height:5px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; &lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;width:550px" &gt;   &lt;tr&gt;     &lt;td style="color:#999;font-family:Arial,sans-serif;font-size:11px;line-height:15px"&gt;       &lt;div&gt; You are receiving &lt;b style="color:#666"&gt;Reminder emails for pending invitations&lt;/b&gt;.         &lt;a href="http://www.linkedin.com/e/994lwf-gybix25p-w/dXTqxoLoR5UOl3VplPzvucCvX98ww9UdwwskCg7/goo/houzhip%2Ecsdev%40blogger%2Ecom/20060/I2002067724_1/?hs=false&amp;amp;tok=2kYPM9eZErTl41"&gt;Unsubscribe.&lt;/a&gt;       &lt;/div&gt;       &lt;div&gt;&amp;copy; 2012 LinkedIn Corporation. 2029 Stierlin Ct, Mountain View, CA 94043, USA.&lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:1px;font-size:1px;line-height:1px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;     &lt;/td&gt;   &lt;/tr&gt; &lt;/table&gt;       &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;   &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-2307338717854222212?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/2307338717854222212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2012/02/reminder-about-your-invitation-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/2307338717854222212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/2307338717854222212'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2012/02/reminder-about-your-invitation-from.html' title='Reminder about your invitation from Heidi (Zhaoling) Y.'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-4986821568533268457</id><published>2012-02-01T09:44:00.001-08:00</published><updated>2012-02-01T09:44:32.329-08:00</updated><title type='text'>Invitation to connect on LinkedIn</title><content type='html'>&lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;" width="100%" bgcolor="#F4F4F4"&gt;&lt;tr&gt;&lt;td align="center"&gt;     &lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;" width="550"&gt;   &lt;tr&gt;&lt;td&gt;     &lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:10px;font-size:10px;line-height:10px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;   &lt;/td&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;td align="left"&gt;     &lt;img src="http://www.linkedin.com/scds/common/u/img/logos/logo_emails_trans_98x24.png" alt="LinkedIn" border="0" height="24" width="98"&gt;   &lt;/td&gt;&lt;/tr&gt;   &lt;tr&gt;&lt;td&gt;     &lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:10px;font-size:10px;line-height:10px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;   &lt;/td&gt;&lt;/tr&gt; &lt;/table&gt;  &lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;border:solid 1px #DDDDDD;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px;" bgcolor="#FFFFFF" width="550"&gt;&lt;tr&gt;&lt;td colspan="3"&gt;&lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:15px;font-size:15px;line-height:15px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td width="1%"&gt;&lt;table width="15" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:0px;font-size:0px;line-height:0px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;td width="98%" valign="top" align=""&gt;   &lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;" width="100%"&gt;     &lt;tr&gt;       &lt;td style="font-family:Arial,sans-serif;font-size:12px"&gt;         &lt;div&gt;           &lt;b style="font-size:16px;margin-right:12px"&gt;From Heidi (Zhaoling) Y.&lt;/b&gt;         &lt;/div&gt;            &lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:6px;font-size:6px;line-height:6px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;            &lt;div style="color:#666666"&gt;Research Associate at University of Waterloo&lt;/div&gt;             &lt;div style="color:#666666"&gt;Kitchener, Canada Area&lt;/div&gt;         &lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:16px;font-size:16px;line-height:16px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;       &lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;       &lt;td style="border:1px dotted #DDDDDD;border-width:1px 0"&gt;         &lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;background:#F2FAFF;width:100%" &gt;         &lt;tr&gt;&lt;td colspan="3"&gt;&lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:4px;font-size:4px;line-height:4px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;         &lt;tr&gt;           &lt;td&gt;&lt;table width="5" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:0px;font-size:0px;line-height:0px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;           &lt;td style="font-family:Arial,sans-serif;font-size:12px"&gt;             &lt;p&gt;               I'd like to add you to my professional network on LinkedIn.&lt;br/&gt; &lt;br/&gt; - Heidi (Zhaoling)             &lt;/p&gt;           &lt;/td&gt;           &lt;td&gt;&lt;table width="5" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:0px;font-size:0px;line-height:0px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;         &lt;/tr&gt;         &lt;tr&gt;&lt;td colspan="3"&gt;&lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:5px;font-size:5px;line-height:5px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;         &lt;/table&gt;       &lt;/td&gt;     &lt;/tr&gt;     &lt;tr&gt;       &lt;td&gt;         &lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:12px;font-size:12px;line-height:12px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;           &lt;table border="0" cellpadding="6" cellspacing="1" align=""&gt;&lt;tr&gt;&lt;td align="center" valign="middle" bgcolor="#FFE86C" background="http://www.linkedin.com/scds/common/u/img/bg/yellow_button_back.png" style="background:url(http://www.linkedin.com/scds/common/u/img/bg/yellow_button_back.png) repeat-x scroll 100% 0 #FFE86C;background-color:#FFE86C;border:1px solid #E8B463;-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;"&gt;&lt;div style="padding-right:10px;padding-left:10px;"&gt;&lt;a href="https://www.linkedin.com/e/994lwf-gy4nbt3w-59/isd/5753160993/2z28XEyM/?hs=false&amp;amp;tok=0Vv3bofoo8MB41" style="text-decoration:none;"&gt;&lt;span style="font-size:12px;font-family:Arial;font-weight:bold;color:#333333;white-space:nowrap;display:block;"&gt;Confirm that you know Heidi (Zhaoling)&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/table&gt; &lt;/td&gt;&lt;td width="1%"&gt;&lt;table width="15" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:0px;font-size:0px;line-height:0px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan="3"&gt;&lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:15px;font-size:15px;line-height:15px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; &lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:5px;font-size:5px;line-height:5px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; &lt;table border="0" cellspacing="0" cellpadding="0" style="font-family:Arial;width:550px" &gt;   &lt;tr&gt;     &lt;td style="color:#999;font-family:Arial,sans-serif;font-size:11px;line-height:15px"&gt;       &lt;div&gt;You are receiving Invitation to Connect emails. &lt;a href="http://www.linkedin.com/e/994lwf-gy4nbt3w-59/dXTqxoLoR5UOl3VplPzvucCvX98ww9UdwwskCg7/goo/houzhip%2Ecsdev%40blogger%2Ecom/20061/I2002067724_1/?hs=false&amp;amp;tok=383UqgbGA8MB41"&gt;Unsubscribe&lt;/a&gt;&lt;/div&gt;       &lt;div&gt;&amp;copy; 2012, LinkedIn Corporation. 2029 Stierlin Ct. Mountain View, CA 94043, USA&lt;table width="1" border="0" cellspacing="0" cellpadding="0"&gt;&lt;tr&gt;&lt;td&gt;&lt;div style="height:1px;font-size:1px;line-height:1px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;     &lt;/td&gt;   &lt;/tr&gt; &lt;/table&gt;       &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;   &lt;img src="http://www.linkedin.com/emimp/994lwf-gy4nbt3w-59.gif" style="width:1px; height:1px;"/&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-4986821568533268457?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/4986821568533268457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2012/02/invitation-to-connect-on-linkedin.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/4986821568533268457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/4986821568533268457'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2012/02/invitation-to-connect-on-linkedin.html' title='Invitation to connect on LinkedIn'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-34058393638360457</id><published>2011-04-06T13:28:00.001-07:00</published><updated>2011-04-06T13:28:54.483-07:00</updated><title type='text'>Different behavior of function atol in VC6, Visual Studio 2005 and Visual Studio 2010</title><content type='html'>Recently we have to upgrade a MFC project that can only compiled in VC6 to Visual Studio 2010. The project is pretty complex with 5 static library and dozens of dynamic linking libraries. After removing all the compiling errors caused by c++ language specification changes such as default function parameter is no long supported in function pointer ans so on, the program seems work now.&lt;div&gt; &lt;br&gt;&lt;/div&gt;&lt;div&gt;However, one test case always fails and we do not know why. It seems that it fails only at certain cases. After spending long time to investigate this crash (a memory crash is finally reported) we found out the reason.&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;In the code we have a function that needs to convert a string to DWORD, which is an &lt;span class="Apple-style-span" style="font-family: monospace; font-size: 13px; white-space: pre; "&gt;unsigned long&lt;/span&gt;. The range of DWORD is &lt;span class="Apple-style-span" style="font-family: &amp;#39;Segoe UI&amp;#39;, Verdana, Arial; font-size: 13px; "&gt; 0 through 4294967295&lt;/span&gt; Most times the conversion works fine as long as it is smaller than 2,147,483,647. The function we used to perform the conversion is atoi(), which converts a string to a signed integer. However, in VC6 the funciton returns a correct value  even if the string contains a integer that is bigger than the maximum signed integer. In Visual Studio 2005, the atoi function returns the maximum value of signed integer, which is 2,147,483,647, if the string contains a bigger value. In Visual Studio 2010 it returns an strange value. Therefore, our code will only work fine in VC6. As soon as it is updated to Visual Studio 2010, a dangerous bug will be introduced.&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The solution of this bug is by replacing the atoi() function with _atoi64(), which will work in all of  the above situations. &lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-34058393638360457?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/34058393638360457/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2011/04/different-behavior-of-function-atol-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/34058393638360457'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/34058393638360457'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2011/04/different-behavior-of-function-atol-in.html' title='Different behavior of function atol in VC6, Visual Studio 2005 and Visual Studio 2010'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-5949318707888108684</id><published>2011-04-06T08:50:00.001-07:00</published><updated>2011-04-06T08:50:37.081-07:00</updated><title type='text'>The project file ‘ ‘ has been renamed or is no longer in the VS 2010 solution file</title><content type='html'>I had a solution file with about 10 projects (some are libraries, some are dlls) that works very well. However, as soon as I change the name of the folder that contains the solution (including all projects) or move the whole solution from C: to D: drive, I will not be able to compile the solution. Instead, I will receive such an error: The project file &amp;#39; &amp;#39; has been renamed or is no longer in the solution.&lt;div&gt; &lt;br&gt;&lt;/div&gt;&lt;div&gt;After checking this problem carefully, I found that the main project (a MFC windows application) that references to other projects are using fixed project path. I think in other project types like C# windows form application all projects are using relative paths.&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;After removing all the project references, the solution compiles properly without any error message.&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-5949318707888108684?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/5949318707888108684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2011/04/project-file-has-been-renamed-or-is-no.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/5949318707888108684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/5949318707888108684'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2011/04/project-file-has-been-renamed-or-is-no.html' title='The project file ‘ ‘ has been renamed or is no longer in the VS 2010 solution file'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-7925405615855427167</id><published>2010-12-23T09:27:00.000-08:00</published><updated>2010-12-23T09:30:20.617-08:00</updated><title type='text'>Error on Entity Framework: Unable to update the EntitySet ... because it has a DefiningQuery and no  element exists in the</title><content type='html'>&lt;br&gt;&lt;div&gt;I have this error with following simple code&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt; ObjectKeyakey = new ObjectKey();&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;        var aw = new entities2();&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;        ObjectQuery&amp;lt;ObjectKey&amp;gt; query2 =&lt;/div&gt; &lt;div&gt;            aw.LicenseKeys.Where(&amp;quot;it.ActivationKey = @ln&amp;quot;, new ObjectParameter(&amp;quot;ln&amp;quot;, strUserActivationKey));&lt;/div&gt;&lt;div&gt;        List&amp;lt;LicenseKey&amp;gt; keyList = new List&amp;lt;LicenseKey&amp;gt;();&lt;/div&gt;&lt;div&gt;         keyList = query2.ToList();&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;        ObjectKey selectedKey = keyList[0];&lt;/div&gt;&lt;div&gt;        selectedKey.ComputerName = &amp;quot;Test Change&amp;quot;;&lt;/div&gt;&lt;div&gt;        int rowsAffected = aw.SaveChanges(true);&lt;/div&gt; &lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The saveChanges function fails with the error say that I have a DefiningQuery and UpdateFunction mapped.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Following post provides a solution to it&lt;/div&gt;&lt;div&gt; &lt;a href="http://social.msdn.microsoft.com/Forums/en/adodotnetentityframework/thread/220262bd-85d4-4f29-96a8-4a7d1d2c8293"&gt;http://social.msdn.microsoft.com/Forums/en/adodotnetentityframework/thread/220262bd-85d4-4f29-96a8-4a7d1d2c8293&lt;/a&gt;&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: &amp;#39;Segoe UI&amp;#39;, &amp;#39;Lucida Grande&amp;#39;, Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: rgb(51, 51, 51); line-height: 16px; "&gt;&lt;ol style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 3em; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 16px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; list-style-type: none; text-decoration: none; "&gt; &lt;li style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; list-style-type: decimal; text-decoration: none; list-style-image: none; "&gt; Right click on the edmx file, select Open with, XML editor&lt;/li&gt;&lt;li style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; list-style-type: decimal; text-decoration: none; list-style-image: none; "&gt; Locate the entity in the edmx:StorageModels element&lt;/li&gt;&lt;li style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; list-style-type: decimal; text-decoration: none; list-style-image: none; "&gt; Remove the DefiningQuery entirely&lt;/li&gt;&lt;li style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; list-style-type: decimal; text-decoration: none; list-style-image: none; "&gt; Rename the store:Schema=&amp;quot;dbo&amp;quot; to Schema=&amp;quot;dbo&amp;quot; (otherwise, the code will generate an error saying the name is invalid)&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The strange part is that in this database model I actually removed all views, and have confirmed that all table have primary keys set properly. Not sure why the DefiningQuery is still generated. &lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Anyway, the problem has been solved by following the above 4 steps.&lt;/div&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-7925405615855427167?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/7925405615855427167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2010/12/error-on-entity-framework-unable-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/7925405615855427167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/7925405615855427167'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2010/12/error-on-entity-framework-unable-to.html' title='Error on Entity Framework: Unable to update the EntitySet ... because it has a DefiningQuery and no &lt;UpdateFunction&gt; element exists in the'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-7151462198325394044</id><published>2010-12-08T12:25:00.001-08:00</published><updated>2010-12-08T12:25:23.616-08:00</updated><title type='text'>BinaryFormatter deserialization exception</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: Verdana; font-size: 9.16667px; "&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana; font-size: 9.16667px; "&gt;&lt;a href="http://connect.microsoft.com/VisualStudio/feedback/details/119402/binaryformatter-fails-to-deserialize"&gt;http://connect.microsoft.com/VisualStudio/feedback/details/119402/binaryformatter-fails-to-deserialize&lt;/a&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: 9.16667px; "&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;The BinaryFormatter always includes version information in the serialized stream even if you set FormatterAssemblyStyle.Simple during serialization. If you try to deserialize the stream after rebuilding the assembly, this will fail, even if you set FormatterAssemblyStyle.Simple during deserialization (fails to load the old assembly version used when creating the serialized stream).&lt;/span&gt;&lt;div&gt; &lt;span class="Apple-style-span" style="font-family: Verdana; font-size: 9.16667px; "&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana; font-size: 9.16667px; "&gt;This is the post that talks about how to make different version of binding compatible when binary formatter is used by applying the concept of &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: &amp;#39;Segoe UI&amp;#39;, Verdana, Arial; font-size: 9.16667px; border-collapse: collapse; line-height: 18px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "&gt;SerializationBinder&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana; font-size: 9.16667px; "&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana; font-size: 9.16667px; "&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.serializationbinder.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.runtime.serialization.serializationbinder.aspx&lt;/a&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-7151462198325394044?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/7151462198325394044/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2010/12/binaryformatter-deserialization.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/7151462198325394044'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/7151462198325394044'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2010/12/binaryformatter-deserialization.html' title='BinaryFormatter deserialization exception'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-1969287892045528639</id><published>2010-11-03T13:42:00.001-07:00</published><updated>2010-11-03T13:42:40.746-07:00</updated><title type='text'>MCV passive design pattern article</title><content type='html'>The following is a good article with sample for MVC design pattern&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.c-sharpcorner.com/UploadFile/rmcochran/PassiveView01262008091652AM/PassiveView.aspx"&gt;http://www.c-sharpcorner.com/UploadFile/rmcochran/PassiveView01262008091652AM/PassiveView.aspx&lt;/a&gt;&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.c-sharpcorner.com/UploadFile/rmcochran/PassiveView01262008091652AM/download/MVC_PassiveViewSample.zip"&gt;http://www.c-sharpcorner.com/UploadFile/rmcochran/PassiveView01262008091652AM/download/MVC_PassiveViewSample.zip&lt;/a&gt;&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-1969287892045528639?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/1969287892045528639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2010/11/mcv-passive-design-pattern-article.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/1969287892045528639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/1969287892045528639'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2010/11/mcv-passive-design-pattern-article.html' title='MCV passive design pattern article'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-461992004122401870</id><published>2010-09-20T12:18:00.001-07:00</published><updated>2010-09-20T12:18:43.439-07:00</updated><title type='text'>How to create an application without any dialog</title><content type='html'>Sometimes we want a simple application to detect the .Net framework installed on a computer before an application installation can continue. A simple console application can do the job. However, we do not want the black console window to be displayed during the installation.&lt;div&gt; &lt;br&gt;&lt;/div&gt;&lt;div&gt;The following solution may solve the problem&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;1. Create a simple Win32 project.&lt;/div&gt;&lt;div&gt;2. In the function&lt;/div&gt;&lt;div&gt;     _int APIENTRY _tWinMain(HINSTANCE hInstance,&lt;/div&gt;&lt;div&gt;                     HINSTANCE hPrevInstance,&lt;/div&gt; &lt;div&gt;                     LPTSTR    lpCmdLine,&lt;/div&gt;&lt;div&gt;                     int       nCmdShow)&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;...&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The default value of nCmdShow is 1. Change it to 0. Application will not display any dialog. &lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Comment out following line of code:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;//// Main message loop:&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;//while (GetMessage(&amp;amp;msg, NULL, 0, 0))&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;//{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;//&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;if (!TranslateAccelerator(msg.hwnd, hAccelTable, &amp;amp;msg))&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;//&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;//&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;TranslateMessage(&amp;amp;msg);&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;//&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;DispatchMessage(&amp;amp;msg);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;//&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;}&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;//}&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;//return (int) msg.wParam;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;return 0;&lt;/div&gt; &lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;After finish the code. Application will exit.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;This article shows how to detect .Net framework installed on a computer with the source code.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt; &lt;div&gt;&lt;a href="http://blogs.msdn.com/b/astebner/archive/2009/06/16/9763379.aspx"&gt;http://blogs.msdn.com/b/astebner/archive/2009/06/16/9763379.aspx&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The code can be downloaded from &lt;/div&gt;&lt;div&gt;&lt;br&gt; &lt;/div&gt;&lt;div&gt;&lt;a href="http://public.blu.livefilestore.com/y1p54ENa2JiMI3dWt4PhavbnoIrOcg4XdMypgSNkmuIYmNOHaOD_xI7seKY4VYfVAxluMqBcmzbQDhf3xIVLTYJ_g/detectfx_new.cpp.txt?psid=1"&gt;http://public.blu.livefilestore.com/y1p54ENa2JiMI3dWt4PhavbnoIrOcg4XdMypgSNkmuIYmNOHaOD_xI7seKY4VYfVAxluMqBcmzbQDhf3xIVLTYJ_g/detectfx_new.cpp.txt?psid=1&lt;/a&gt;&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;It works great.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-461992004122401870?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/461992004122401870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2010/09/how-to-create-application-without-any.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/461992004122401870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/461992004122401870'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2010/09/how-to-create-application-without-any.html' title='How to create an application without any dialog'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-2059153604996634148</id><published>2010-09-19T10:26:00.001-07:00</published><updated>2010-09-19T10:26:41.228-07:00</updated><title type='text'>Decompress large gzip file</title><content type='html'>&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;.&lt;/span&gt;Net GZipStream has a limitation of 4GB. It can not be used to compress/decompress files which are greater than 4gb. The following code overcomes the limitation.using dotnetzip library downloaded from &lt;a href="http://dotnetzip.codeplex.com/"&gt;http://dotnetzip.codeplex.com/&lt;/a&gt; &lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;This code can unzip a Zip format file if the passed in file is right format. &lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;public static string Decompress( string strPath, string dstFile, bool bIsZipFile)&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;if ( bIsZipFile == true)&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;{&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;if ( File.Exists( dstFile ) )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;File.Delete( dstFile );&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;if ( File.Exists( strPath ) == false )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;{&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;return strPath;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;string strFolder = Path.GetDirectoryName( strPath );&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;Ionic.Zip.ZipFile zipFile = new Ionic.Zip.ZipFile( strPath );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;zipFile.ExtractAll( strFolder );&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;zipFile.Dispose();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;return dstFile;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;}&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;FileStream fsIn = null;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;FileStream fsOut = null;&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;//GZipStream gzip = null;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;        Ionic.Zlib.GZipStream gzip = null;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;const int bufferSize = 4096;&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;byte[] buffer = new byte[ bufferSize ];&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;int count = 0;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;        List&amp;lt;string&amp;gt; lstExtraFilesToBeMerged = new List&amp;lt;string&amp;gt;();&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;try&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;if ( File.Exists( strPath ) == false )&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;return strPath;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;}&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;if ( File.Exists( dstFile ) )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;File.Delete(dstFile);&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;fsIn = new FileStream( strPath, FileMode.Open, FileAccess.Read, FileShare.Read );&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;fsOut = new FileStream( dstFile, FileMode.Create, FileAccess.Write, FileShare.None );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;if ( bIsGZip == true )&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;                //gzip = new Ionic.Zlib.GZipStream(fsIn, CompressionMode.Decompress, true);&lt;/div&gt;&lt;div&gt;                gzip = new Ionic.Zlib.GZipStream(fsIn, Ionic.Zlib.CompressionMode.Decompress, true);&lt;/div&gt; &lt;div&gt;                while (true)&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;                    //if (fsOut.Length &amp;gt; 100000)&lt;/div&gt;&lt;div&gt;                    //{&lt;/div&gt;&lt;div&gt;                    //    gzip.Close();&lt;/div&gt; &lt;div&gt;                    //    gzip = new GZipStream(fsIn, CompressionMode.Decompress, true);&lt;/div&gt;&lt;div&gt;                    //}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;count = gzip.Read( buffer, 0, bufferSize );&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;if ( count != 0 )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;						&lt;/span&gt;fsOut.Write( buffer, 0, count );&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;if ( count != bufferSize )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;{&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;						&lt;/span&gt;// have reached the end&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;						&lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;}&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;}&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;catch ( Exception ex )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;// handle or display the error&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;throw ( new Exception( &amp;quot;Decompress failed.&amp;quot;, ex ) );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;finally&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;if ( gzip != null )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;{&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;gzip.Close();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;gzip = null;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;}&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;if ( fsOut != null )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;fsOut.Close();&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;fsOut = null;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;                if (lstExtraFilesToBeMerged.Count &amp;gt; 0)&lt;/div&gt;&lt;div&gt;                {&lt;/div&gt;&lt;div&gt;                    MergeFile(dstFile, lstExtraFilesToBeMerged);&lt;/div&gt; &lt;div&gt;                }&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;if ( fsIn != null )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;{&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;fsIn.Close();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;fsIn = null;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;}&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;return dstFile;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;} &lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-2059153604996634148?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/2059153604996634148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2010/09/decompress-large-gzip-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/2059153604996634148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/2059153604996634148'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2010/09/decompress-large-gzip-file.html' title='Decompress large gzip file'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-4217329609732317197</id><published>2010-09-17T13:11:00.001-07:00</published><updated>2010-09-17T13:12:39.029-07:00</updated><title type='text'>Customize predefined dialogs in Microsoft Installation Project in Visual Studio 2010</title><content type='html'>&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "&gt;&lt;div&gt;We can update the dialogs defined in the following folders using ORCA.exe&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools\Deployment\VsdDialogs\&lt;/div&gt; &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The ORCA can be downloaded from following link&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa370557(VS.85).aspx"&gt;http://msdn.microsoft.com/en-us/library/aa370557(VS.85).aspx&lt;/a&gt;&lt;/div&gt; &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This link gives example to add new controls in the dialog&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: small; "&gt;&lt;a href="http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/1f8b14f7-2af6-4f54-950c-c5255b1853f1"&gt;http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/1f8b14f7-2af6-4f54-950c-c5255b1853f1&lt;/a&gt;&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; color: rgb(51, 51, 51); line-height: 16px; "&gt;1. Open %Visual Studio folder%\Common7\Tools\Deployment\VsdDialogs\1033\VsdFolderDlg.wid with Orca.&lt;br /&gt;&lt;br /&gt;2. Since we'd like to add a editbox and a button in the folder dialog, we need to add two rows for these two controls in the Control table. I name the new editbox "FolderEdit2" and new browse button "BrowseButton2".&lt;br /&gt;&lt;br /&gt;3. In the row for the FolderEdit2, specify a property under the Property column. I name it "DATAFILEDIR".&lt;br /&gt;&lt;br /&gt;4. Because the FolderEdit2 is now the next control of the BrowseButton, change the ControlNext property of the BrowseButton to FolderEdit2.&lt;br /&gt;&lt;br /&gt;5. In the ControlEvent table, add two rows for the "SpawnDialog" and "[SelectFolderDialog_Property]" events of BrowseButton2.&lt;br /&gt;&lt;br /&gt;6. Since "DATAFILEDIR" is used as a directory, we need to add a row for it in the Directory table.&lt;br /&gt;&lt;br /&gt;7. Change the display name of the custom dialog. To do this, navigate to the ModuleDialog table and change the value under the DisplayName column. I change the value to "Custom Installation Folder".&lt;br /&gt;&lt;br /&gt;8. Save as VsdCustomFolderDlg.wid(this file is saved in the same path as VsdFolderDlg.wid file).&lt;br /&gt;&lt;br /&gt;9. Open a setup project in Visual Studio.&lt;br /&gt;&lt;br /&gt;10. In the User Interface editor, right click on the Install | Start node and choose "Add Dialog". "Add Dialog" window opens with the "Custom Installation Folder" dialog in it. Add this custom dialog just after the Welcome dialog in the User Interface editor.&lt;br /&gt;&lt;br /&gt;11. In the File System editor, add a custom folder in it. Change the "Property" of this custom folder to "DATAFILEDIR". Add a file to this custom folder, e.g. test.txt.&lt;br /&gt;&lt;br /&gt;12. Build the setup project and install the resulting MSI package. In the "Select Installation Folder" dialog, two editbox and two browse buttons show. Specify a path in the second editbox, e.g. d:\myfolder, and then the test.txt file is installed in the path "d:\myfolder".&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-4217329609732317197?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/4217329609732317197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2010/09/re-customize-predefined-dialogs-in.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/4217329609732317197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/4217329609732317197'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2010/09/re-customize-predefined-dialogs-in.html' title='Customize predefined dialogs in Microsoft Installation Project in Visual Studio 2010'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-2434974340410274678</id><published>2010-09-09T08:36:00.001-07:00</published><updated>2010-09-09T08:36:29.558-07:00</updated><title type='text'>Print preview and html document using IE control in C#</title><content type='html'>&lt;div&gt;In order to print/print preview a html file created by a c# windows application, the SHDocVw dll is used. &lt;/div&gt; &lt;div&gt; &lt;/div&gt; &lt;div&gt;First, an InternetExplorer instance is created: &lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt; &lt;p&gt;SHDocVw.&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;InternetExplorer&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; ie = &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; SHDocVw.&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;InternetExplorerClass&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;();&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;div&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt; &lt;/div&gt; &lt;div&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;Secondly, the document is opened using the InterenetExplorer object:&lt;/font&gt;&lt;/font&gt;&lt;/div&gt; &lt;div&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;&lt;/font&gt;&lt;/font&gt; &lt;/div&gt; &lt;div&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt; &lt;p&gt;Object&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; obj = &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;Object&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;();&lt;/font&gt;&lt;/font&gt; &lt;p&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;ie.Navigate(strPath, &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;ref&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; obj, &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;ref&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; obj, &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;ref&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; obj, &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;ref&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; obj);&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt; &lt;p&gt;The strPath above can be either a local html file or a real webpage from internet.&lt;/p&gt; &lt;p&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;After this, the InternetExplorer instance will be used as a com object to carry out print and print preview command.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Just note that in Windows 7, a special object retrieval must be added because after the ie navigate to a local document, it become invalid and all later operation will fail.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;The following is a complete function that print and print preview a document using IE in C#. It works for Visual Studion 2005/2010, on Windows XP and Windows 7.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt; &lt;/p&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; &lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;static&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;void&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; PrintHtmlDocument( &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;bool&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; bPrintPreview, &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; strPath )&lt;/font&gt;&lt;/font&gt; &lt;p&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; &lt;p&gt;            SHDocVw.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;InternetExplorer&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; ie = &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; SHDocVw.&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;InternetExplorerClass&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;();&lt;/font&gt;&lt;/font&gt; &lt;p&gt;            &lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;Object&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; obj = &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;Object&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;();&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;            ie.Navigate(strPath, &lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;ref&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; obj, &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;ref&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; obj, &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;ref&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; obj, &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;ref&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; obj);&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#008000" size="2" face="Consolas"&gt;&lt;font color="#008000" size="2" face="Consolas"&gt;&lt;font color="#008000" size="2" face="Consolas"&gt;           /*&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;           * The following section is used to deal with the exception caused by the Windows 7. &lt;/p&gt; &lt;p&gt;           * In windows 7, the object will become invalid after Navigate function even though the user interface shows the file is loaded&lt;/p&gt; &lt;p&gt;           * The following section will first let the application to wait for 250ms, then query all the IE window to find the last IE window that show&lt;/p&gt; &lt;p&gt;           * the loaded document.&lt;/p&gt; &lt;p&gt;          */&lt;/p&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; &lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;         Thread&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;.Sleep(150); &lt;p&gt;         SHDocVw.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;ShellWindows&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; shellWindows = &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; SHDocVw.&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;ShellWindowsClass&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;();&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; &lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;         foreach&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; (SHDocVw.&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;InternetExplorer&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; ie2 &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;in&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; shellWindows) &lt;p&gt;         {&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; &lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;              try&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; &lt;p&gt;              {&lt;/p&gt; &lt;p&gt;                    mshtml.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;IHTMLDocument2&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; doc2 = ie2.Document &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;as&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; mshtml.&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;IHTMLDocument2&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;; &lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;                    string&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; strTargetFileName = &lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;Path&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;.GetFileName(strPath); &lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;                    string&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; strUrl = ie2.LocationURL.ToString(); &lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;                    if&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; (strUrl.Contains(strTargetFileName)) &lt;p&gt;                    {&lt;/p&gt; &lt;p&gt;                          ie = ie2;&lt;/p&gt; &lt;p&gt;                    }&lt;/p&gt; &lt;p&gt;             }&lt;/p&gt; &lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;            catch&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; (&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;Exception&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; eee) &lt;p&gt;            {&lt;/p&gt; &lt;p&gt;            }&lt;/p&gt; &lt;p&gt;       }&lt;/p&gt; &lt;p&gt;　&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; &lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;     try&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; &lt;p&gt;     {&lt;/p&gt; &lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;           try&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; &lt;p&gt;           {&lt;/p&gt; &lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#008000" size="2" face="Consolas"&gt;&lt;font color="#008000" size="2" face="Consolas"&gt;&lt;font color="#008000" size="2" face="Consolas"&gt;                 //wait until the DHTMLEdit control load the whole document&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; &lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;                 for&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; (; ie.Busy != &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;false&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;; ) &lt;p&gt;                 {&lt;/p&gt; &lt;p&gt;                        System.Windows.Forms.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;Application&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;.DoEvents(); &lt;p&gt;                 }&lt;/p&gt; &lt;p&gt;         }&lt;/p&gt; &lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;        catch&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; (&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;Exception&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; eee) &lt;p&gt;        { &lt;/p&gt; &lt;p&gt;        }&lt;/p&gt; &lt;p&gt;       mshtml.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;IHTMLDocument2&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; doc = ie.Document &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;as&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; mshtml.&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;IHTMLDocument2&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;; &lt;p&gt;       SHDocVw.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;OLECMDF&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; cmd = ie.QueryStatusWB(SHDocVw.&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;OLECMDID&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;.OLECMDID_PRINTPREVIEW); &lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;      if&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; (bPrintPreview == &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;false&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;) &lt;p&gt;     {&lt;/p&gt; &lt;p&gt;         cmd = ie.QueryStatusWB(SHDocVw.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;OLECMDID&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;.OLECMDID_PRINT); &lt;p&gt;     }&lt;/p&gt; &lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;    else&lt;/font&gt;&lt;/font&gt;&lt;/font&gt; &lt;p&gt;&lt;font color="#0000ff"&gt;    &lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;{&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;         ie.Visible = &lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;true&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;         object&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; pvaIn;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;         if&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; (strPath == &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;string&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;.Empty)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;         {&lt;/p&gt; &lt;p&gt;             pvaIn = &lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;null&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;        }&lt;/p&gt; &lt;p&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;        else&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;if&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; (!System.IO.&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;File&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;.Exists(strPath))&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;        {&lt;/p&gt; &lt;p&gt;               pvaIn = &lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;null&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;        }&lt;/p&gt; &lt;p&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;       else&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; &lt;p&gt;       {&lt;/p&gt; &lt;p&gt;             pvaIn = strPath;&lt;/p&gt; &lt;p&gt;        }&lt;/p&gt; &lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;        bool&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; bPromptUser = &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;true&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;; &lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;       Object&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; pvaout = &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;null&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;; &lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;       object&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; pv = &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;null&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;; &lt;p&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;       object&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; pva = &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;null&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;; &lt;p&gt;       ie.ExecWB(SHDocVw.&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;OLECMDID&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;.OLECMDID_PRINTPREVIEW, SHDocVw.&lt;/font&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;&lt;font color="#2b91af" size="2" face="Consolas"&gt;OLECMDEXECOPT&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt;.OLECMDEXECOPT_DODEFAULT, &lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;ref&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; &lt;p&gt;           pv, &lt;/p&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;&lt;font color="#0000ff" size="2" face="Consolas"&gt;ref&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; pva); &lt;p&gt; }&lt;/p&gt;&lt;/font&gt;&lt;/font&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;&lt;font size="2" face="Consolas"&gt;&lt;font size="2" face="Consolas"&gt; &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-2434974340410274678?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/2434974340410274678/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2010/09/print-preview-and-html-document-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/2434974340410274678'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/2434974340410274678'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2010/09/print-preview-and-html-document-using.html' title='Print preview and html document using IE control in C#'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-7562276065852119369</id><published>2010-08-12T12:44:00.001-07:00</published><updated>2010-08-12T12:44:47.460-07:00</updated><title type='text'>Datagridview Combobox column throws NullReferenceExceptions</title><content type='html'>I used several datagridview. Most of them work fine. However, one of them uses datatable binding and then from time to time, following exception is thrown.&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 11px; "&gt;System.NullReferenceException was unhandled&lt;br&gt; Message=&amp;quot;Object reference not set to an instance of an object.&amp;quot;&lt;br&gt;Source=&amp;quot;System.Windows.Forms&amp;quot;&lt;br&gt;StackTrace:&lt;br&gt;at &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 11px; "&gt;System.Windows.Forms.DataGridView.InitializeEditingControlValue(DataGridViewCellStyle&amp;amp; dataGridViewCellStyle, DataGridViewCell dataGridViewCell)&lt;br&gt; at System.Windows.Forms.DataGridView.BeginEditInternal(Boolean &lt;br&gt;selectAll)&lt;br&gt;at System.Windows.Forms.DataGridView.BeginEdit(Boolean selectAll)&lt;br&gt;at &lt;br&gt;System.Windows.Forms.DataGridViewComboBoxCell.OnMouseClick(DataGridViewCellMouseEventArgs e)&lt;br&gt; at &lt;br&gt;System.Windows.Forms.DataGridView.OnCellMouseClick(DataGridViewCellMouseEventArgs e)&lt;br&gt;at System.Windows.Forms.DataGridView.OnMouseClick(MouseEventArgs e)&lt;br&gt;at System.Windows.Forms.Control.WmMouseUp(Message&amp;amp; m, MouseButtons &lt;br&gt; button, Int32 clicks)&lt;br&gt;at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)&lt;br&gt;at System.Windows.Forms.DataGridView.WndProc(Message&amp;amp; m)&lt;br&gt;at &lt;br&gt;System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)&lt;br&gt; at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)&lt;br&gt;at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, &lt;br&gt;Int32 msg, IntPtr wparam, IntPtr lparam)&lt;br&gt;at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)&lt;br&gt; at &lt;br&gt;System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32&lt;br&gt;dwComponentID, Int32 reason, Int32 pvLoopData)&lt;br&gt;at &lt;br&gt;System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 &lt;br&gt; reason, ApplicationContext context)&lt;br&gt;at &lt;br&gt;System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, &lt;br&gt;ApplicationContext context)&lt;br&gt;at System.Windows.Forms.Application.Run(ApplicationContext context)&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 11px; "&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 11px; "&gt;It looks that sometimes several people have got the same error and however I have not seen any solution to this error yet. Maybe I should just avoid the datatable binding with the combobox for now.&lt;/span&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-7562276065852119369?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/7562276065852119369/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2010/08/datagridview-combobox-column-throws.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/7562276065852119369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/7562276065852119369'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2010/08/datagridview-combobox-column-throws.html' title='Datagridview Combobox column throws NullReferenceExceptions'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-8964802126856356830</id><published>2010-07-09T13:48:00.001-07:00</published><updated>2010-07-09T13:48:41.828-07:00</updated><title type='text'>Another difference of BinaryFormatter and XmlSerializer</title><content type='html'>In this discussion the list of difference between above two serialization method is provided. However, I recently found another case that I need to use binary formatter instead of XMLSerializer.&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;In a dialog I have a multiple line text box editor to represent a object attribute. If I use xmlseriealizer to save and load the attribute, the text will become one long line instead of multiple lines. However, with BinaryFormatter, the text will be saved and loaded exactly as it is entered in the multiple line text box editor.&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The following code is the method to save and load an object using xml serialization. (Not complete code)&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Save:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;System.Xml.Serialization.XmlSerializer writer = new System.Xml.Serialization.XmlSerializer( this.GetType() );&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;System.IO.StreamWriter file;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;file = new System.IO.StreamWriter( strFileName );&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;// serialize the contents of the object&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;writer.Serialize( file, this );&lt;/div&gt;&lt;div&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;file.Close();&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Load:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;System.Xml.Serialization.XmlSerializer reader = new System.Xml.Serialization.XmlSerializer( this.GetType() );&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;System.IO.StreamReader file;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;file = new System.IO.StreamReader( strFileName );&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;// deserialize the contents of the object&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;MyObject savedObject = ( MyObject ) reader.Deserialize( file );&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;file.Close();&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The following are the codes to save and load &lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Save:&lt;/div&gt; &lt;div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;//open the file to save the object&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;FileStream fs = new FileStream( strFileName, FileMode.Create );&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;BinaryFormatter bf = new BinaryFormatter();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;bf.Serialize( fs, this );&lt;/div&gt;&lt;div&gt; &lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;// close the file&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;fs.Close();&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt; &lt;div&gt;Load:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;FileStream fs = null;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;fs = new FileStream( strFileName, FileMode.Open );&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;// Create a BinaryFormatter object to perform the deserialization&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;BinaryFormatter bf = new BinaryFormatter();&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;MyObject savedObject = ( MyObject ) bf.Deserialize( fs );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;// Close the file&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;fs.Close();&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-8964802126856356830?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/8964802126856356830/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2010/07/another-difference-of-binaryformatter.html#comment-form' title='15 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/8964802126856356830'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/8964802126856356830'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2010/07/another-difference-of-binaryformatter.html' title='Another difference of BinaryFormatter and XmlSerializer'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-4845317217572016930</id><published>2010-05-27T11:29:00.000-07:00</published><updated>2010-05-27T11:30:59.614-07:00</updated><title type='text'>Image List Memory Leakage</title><content type='html'>&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I have followed following article.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://blog.ramondeklein.nl/index.php/2009/05/18/listview-may-leak-with-imagelists/"&gt;http://blog.ramondeklein.nl/index.php/2009/05/18/listview-may-leak-with-imagelists/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, after a few times of recreation of image list, the system GDI object still gets messed up.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="https://connect.microsoft.com/VisualStudio/feedback/details/453810/using-imagelists-with-system-windows-forms-listview-control-may-leak-memory#"&gt;https://connect.microsoft.com/VisualStudio/feedback/details/453810/using-imagelists-with-system-windows-forms-listview-control-may-leak-memory#&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-4845317217572016930?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/4845317217572016930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2010/05/image-list-memory-leakage.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/4845317217572016930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/4845317217572016930'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2010/05/image-list-memory-leakage.html' title='Image List Memory Leakage'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-7167880582926522451</id><published>2010-04-20T17:39:00.000-07:00</published><updated>2010-05-27T11:29:11.695-07:00</updated><title type='text'>Could not load file or assembly</title><content type='html'>&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;I am using Asp.Net 2.0 and Visual Web Developer 2005 Express Edition on Windows Vista. &lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;My application works fine until this morning I got following error:&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style=" color: rgb(51, 51, 51);  line-height: 16px; font-family:'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif;font-size:13px;"&gt;&lt;h1 href="http://social.msdn.microsoft.com:80/Forums/en-US/csharpide/thread/352c58ec-65d8-4d77-ac7b-d2338c621ef3" style="border-style: initial; border-color: initial; font-style: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; clear: both; color: rgb(38, 8, 89); line-height: 28px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; list-style-type: none; text-decoration: none; "&gt;&lt;span name="subject"  style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-style: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color:initial;"&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Could not load file or assembly … The parameter is incorrect … HRESULT: 0x80070057 (E_INVALIDARG)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span name="subject"  style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-style: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color:initial;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span name="subject"  style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-style: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color:initial;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;After deleting the following folder everything works fine again.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span name="subject"  style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-style: inherit; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color:initial;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span name="subject"  style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline- padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color:initial;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;C:\Users\[User Name]\AppData\Local\Temp\Temporary ASP.NET Files&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span name="subject"  style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline- padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color:initial;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span name="subject"  style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline- padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color:initial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-7167880582926522451?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/7167880582926522451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2010/04/could-not-load-file-or-assembly.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/7167880582926522451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/7167880582926522451'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2010/04/could-not-load-file-or-assembly.html' title='Could not load file or assembly'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-6480965366631202217</id><published>2010-04-09T13:13:00.001-07:00</published><updated>2010-04-09T13:13:04.486-07:00</updated><title type='text'>A Bug Of Black Background For Combo Box Column In DataGridView</title><content type='html'>This bug has trapped me for days. Finally I got some clue from here:&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Helvetica, Verdana, Arial, sans-serif; font-size: medium; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "&gt;&lt;h1 style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 22px; color: rgb(0, 41, 94); font-weight: bold; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 28px; "&gt; &lt;a href="http://www.geekpedia.com/Thread12474_A-Bug-Of-Black-Background-For-Combo-Box-Column-In-DataGridView.html"&gt;http://www.geekpedia.com/Thread12474_A-Bug-Of-Black-Background-For-Combo-Box-Column-In-DataGridView.html&lt;/a&gt;&lt;/h1&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;It really helps&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; "&gt;&lt;table border="0" width="100%"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td colspan="3" class="ArtContent" style="background-color: rgb(255, 255, 255); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(229, 241, 254); border-right-color: rgb(229, 241, 254); border-bottom-color: rgb(229, 241, 254); border-left-color: rgb(229, 241, 254); padding-top: 12px; padding-right: 12px; padding-bottom: 12px; padding-left: 12px; color: rgb(0, 0, 0); font-size: 12px; line-height: 20px; font-family: Geneva, Arial, Helvetica, sans-serif; "&gt; I have this problem with both &lt;a href="http://www.geekpedia.com/Thread12474_A-Bug-Of-Black-Background-For-Combo-Box-Column-In-DataGridView.html#" class="kLink" target="undefined" id="KonaLink1" style="color: rgb(0, 104, 55) !important; text-decoration: underline !important; border-bottom-style: none !important; cursor: pointer; font-family: verdana; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-top-style: none !important; border-right-style: none !important; border-left-style: none !important; border-top-color: transparent !important; border-right-color: transparent !important; border-bottom-color: transparent !important; border-left-color: transparent !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; text-transform: none !important; display: inline !important; font-variant: normal; top: 0px; right: 0px; bottom: 0px; left: 0px; position: static; "&gt;&lt;font color="#006837" style="color: rgb(0, 104, 55) !important; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: normal; font-size: 12px; position: static; "&gt;&lt;span class="kLink" style="border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: rgb(0, 104, 55) !important; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: normal; font-size: 12px; position: static; "&gt;VS &lt;/span&gt;&lt;span class="kLink" style="border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: rgb(0, 104, 55) !important; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: normal; font-size: 12px; position: static; "&gt;2005&lt;/span&gt;&lt;/font&gt;&lt;/a&gt; and 2008. Each time we use this event: &lt;br&gt; private void OnEditControlShowing(object sender,&lt;br&gt;DataGridViewEditingControlShowingEventArgs e)&lt;br&gt;in DataGridView, the background &lt;a href="http://www.geekpedia.com/Thread12474_A-Bug-Of-Black-Background-For-Combo-Box-Column-In-DataGridView.html#" class="kLink" target="undefined" id="KonaLink3" style="color: rgb(0, 104, 55) !important; text-decoration: underline !important; border-bottom-style: none !important; cursor: pointer; font-family: verdana; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-top-style: none !important; border-right-style: none !important; border-left-style: none !important; border-top-color: transparent !important; border-right-color: transparent !important; border-bottom-color: transparent !important; border-left-color: transparent !important; background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: transparent !important; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; text-transform: none !important; display: inline !important; font-variant: normal; top: 0px; right: 0px; bottom: 0px; left: 0px; position: static; "&gt;&lt;font color="#006837" style="color: rgb(0, 104, 55) !important; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: normal; font-size: 12px; position: static; "&gt;&lt;span class="kLink" style="border-top-width: 0px !important; border-top-style: none !important; border-top-color: initial !important; border-left-width: 0px !important; border-left-style: none !important; border-left-color: initial !important; border-right-width: 0px !important; border-right-style: none !important; border-right-color: initial !important; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: initial; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 1px !important; padding-left: 0px !important; color: rgb(0, 104, 55) !important; background-image: none; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; width: auto !important; float: none !important; display: inline !important; font-family: Geneva, Arial, Helvetica, sans-serif; font-weight: normal; font-size: 12px; position: static; "&gt;color&lt;/span&gt;&lt;/font&gt;&lt;/a&gt; of the combo box column becomes &lt;br&gt; totally black, which makes the items in the combo box difficult to see. If &lt;br&gt;it does not happen in the first look at the combo box, clicking a combo box &lt;br&gt;in another row will definitely show the problem. Very easy to replicate!&lt;br&gt; &lt;br&gt;I would appreciate it if anyone can tell me how to get around this &lt;br&gt;bug/problem.&lt;br&gt;&lt;br&gt;Thanks!&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="MiniTitle" colspan="2" style="background-color: rgb(242, 248, 255); padding-top: 4px; padding-right: 6px; padding-bottom: 4px; padding-left: 6px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 11px; "&gt; &lt;h2 style="color: rgb(0, 66, 158); font-size: 12px; font-family: Calibri, Arial, Helvetica, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font-weight: bold; display: inline; "&gt;Re: A bug of black background for Combo box Column in DataGridView &lt;/h2&gt; by &lt;b&gt;outlaw&lt;/b&gt; on &lt;b&gt;Tuesday, May 6th 2008&lt;/b&gt; at &lt;b&gt;07:05 AM&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan="2" class="ArtContent" style="background-color: rgb(255, 255, 255); border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(229, 241, 254); border-right-color: rgb(229, 241, 254); border-bottom-color: rgb(229, 241, 254); border-left-color: rgb(229, 241, 254); padding-top: 12px; padding-right: 12px; padding-bottom: 12px; padding-left: 12px; color: rgb(0, 0, 0); font-size: 12px; line-height: 20px; font-family: Geneva, Arial, Helvetica, sans-serif; "&gt; Hi, i have faced the same problem &amp;amp; solved it by resetting the combo&amp;#39;s&lt;br&gt;backgroud color at it&amp;#39;s GotFocus &amp;amp; Dropdown event. C the following:&lt;br&gt;&lt;br&gt;&lt;br&gt;private void combo_SelectedIndexChanged(object sender, EventArgs e)&lt;br&gt; {&lt;br&gt;_MyController.CalculateTotal();&lt;br&gt;DataGridViewComboBoxEditingControl combo =&lt;br&gt;(DataGridViewComboBoxEditingControl)sender;&lt;br&gt;combo.SelectedIndexChanged -= new&lt;br&gt;EventHandler(combo_SelectedIndexChanged);&lt;br&gt;combo.DropDown += new EventHandler(combo_DropDown);&lt;br&gt; combo.GotFocus += new EventHandler(combo_DropDown);&lt;br&gt;}&lt;br&gt;&lt;br&gt;void combo_DropDown(object sender, EventArgs e)&lt;br&gt;{&lt;br&gt;((DataGridViewComboBoxEditingControl)sender).BackColor =&lt;br&gt;Color.White;&lt;br&gt;}&lt;br&gt;&lt;br&gt;&lt;br&gt;Hope this will help u.&lt;br&gt; &lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-6480965366631202217?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/6480965366631202217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2010/04/bug-of-black-background-for-combo-box.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/6480965366631202217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/6480965366631202217'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2010/04/bug-of-black-background-for-combo-box.html' title='A Bug Of Black Background For Combo Box Column In DataGridView'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-1412502301527075844</id><published>2009-12-01T12:06:00.001-08:00</published><updated>2009-12-01T12:06:50.214-08:00</updated><title type='text'>Type conversion of C++ and C#</title><content type='html'>&lt;div&gt;In C++, type conversion can access member variable. However, in C#, type conversion can not. Every time we cast a type A object to Type B, a new object of Type B will be created.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The following is how type conversion operator is implemented in c++.&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;=========================================================&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;#include &amp;quot;stdafx.h&amp;quot;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;class TypeA&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;public: &lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;int a;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;    char b;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;TypeA&amp;amp; TypeA::operator=(const double d)&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;this-&amp;gt;a = d;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;return *this;&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;operator const double ()&lt;/div&gt;&lt;div&gt;    {&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;return this-&amp;gt;a;&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;    }&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;};&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;int _tmain(int argc, _TCHAR* argv[])&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;TypeA a;&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;a=3;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;a.a = 5;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;double d =(double)a;&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;return 0;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;=========================================================&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt; &lt;div&gt;The following sample shows how to implement type conversion in c#&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;========================================================&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;using System;&lt;/div&gt;&lt;div&gt;using System.Collections.Generic;&lt;/div&gt; &lt;div&gt;using System.Text;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;namespace ConsoleApplication1&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;class TypeA&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;{&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;public int a;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;public int b;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;public static implicit operator TypeA( double d )&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;TypeA TypeA = new TypeA();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;TypeA.a = (int)d;&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;return TypeA;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;public static implicit operator double( TypeA TypeA )&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;return TypeA.a; &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;}&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;class Program&lt;/div&gt;&lt;div&gt; &lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;static void Main( string[] args )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;{&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;TypeA a = 2.5;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;			&lt;/span&gt;double b = a;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;}&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;==========================================================&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-1412502301527075844?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/1412502301527075844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2009/12/type-conversion-of-c-and-c.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/1412502301527075844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/1412502301527075844'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2009/12/type-conversion-of-c-and-c.html' title='Type conversion of C++ and C#'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-576389485683757576</id><published>2009-10-21T13:06:00.001-07:00</published><updated>2009-10-21T13:06:37.428-07:00</updated><title type='text'>listview imagelist resource leakage</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: &amp;#39;Lucida Grande&amp;#39;, &amp;#39;Lucida Sans Unicode&amp;#39;, Arial, Helvetica, Sans, FreeSans, Jamrul, Garuda, Kalimati; font-size: 13px; "&gt;&lt;h2 style="margin-top: 0.5em; margin-right: 0px; margin-bottom: 0.2em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: &amp;#39;Palatino Linotype&amp;#39;, Georgia, Tahoma, &amp;#39;Century Schoolbook L&amp;#39;, Arial, Helvetica; font-size: 20px; font-weight: bold; letter-spacing: -0.04em; "&gt; ListView may leak with ImageLists&lt;/h2&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I have worked with the issue for several days. Basically as long as I set the state image list for a list view, I will end up with a big GDI Object leakage and eventually the listview will not be able to work properly.&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;Following article describes the issue more clearly.&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://blog.ramondeklein.nl/index.php/2009/05/18/listview-may-leak-with-imagelists/"&gt;http://blog.ramondeklein.nl/index.php/2009/05/18/listview-may-leak-with-imagelists/&lt;/a&gt;&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-576389485683757576?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/576389485683757576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2009/10/listview-imagelist-resource-leakage.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/576389485683757576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/576389485683757576'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2009/10/listview-imagelist-resource-leakage.html' title='listview imagelist resource leakage'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-665993288774169480</id><published>2009-10-13T07:02:00.001-07:00</published><updated>2009-10-13T07:02:33.095-07:00</updated><title type='text'>Use Web Browser control to print and preview a html document</title><content type='html'>&lt;div&gt;The following article provides the idea to print preview using web browser.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;a href="http://www.developmentnow.com/g/36_2003_7_0_0_192939/Preview-control.htm"&gt;http://www.developmentnow.com/g/36_2003_7_0_0_192939/Preview-control.htm&lt;/a&gt;&lt;div&gt; &lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.developmentnow.com/g/36_2003_7_0_0_192939/Preview-control.htm"&gt;&lt;/a&gt;Make sure the web browser control is visible and in a windows form.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;div&gt;=======================&lt;/div&gt;&lt;div&gt; &lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 12px; line-height: 14px; "&gt;You can use COM object Microsoft Web Browser (customize your toolbox)&lt;br&gt;After that put the web browser control to form.&lt;br&gt; &lt;br&gt;In your code it looks like:&lt;br&gt;private AxSHDocVw.AxWebBrowser axWebBrowser1;&lt;br&gt;&lt;br&gt;You can get HTML content and show it so:&lt;br&gt;object flags=null;&lt;br&gt;object postData=null;&lt;br&gt;object header=null;&lt;br&gt;object targetFrame=null;&lt;br&gt; axWebBrowser1.Navigate(&amp;quot;&lt;a href="http://www.namip.ru"&gt;www.namip.ru&lt;/a&gt;&amp;quot;, ref flags, ref targetFrame, ref &lt;br&gt;postData, ref header);&lt;br&gt;&lt;br&gt;When the fetching will be finished you can do so:&lt;br&gt;object pv = null;&lt;br&gt; object pva = null;&lt;br&gt;axWebBrowser1.ExecWB(SHDocVw.OLECMDID.OLECMDID_PRINTPREVIEW,SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT,ref&lt;br&gt;pv, ref pva);&lt;br&gt;&lt;br&gt;===========================&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif" size="3"&gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: 14px;"&gt;&lt;br&gt; &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif" size="3"&gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: 14px;"&gt;We can also use the IE browser to directly perform the task.&lt;/span&gt;&lt;/font&gt;&lt;/div&gt; &lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif" size="3"&gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: 14px;"&gt;&lt;br&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif" size="3"&gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: 14px;"&gt;================================&lt;/span&gt;&lt;/font&gt;&lt;/div&gt; &lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif" size="3"&gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: 14px;"&gt;&lt;br&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif" size="3"&gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: 14px;"&gt;&lt;br&gt; &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif" size="3"&gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: 14px;"&gt;&lt;div&gt;                SHDocVw.InternetExplorer browser = new SHDocVw.InternetExplorerClass();&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;browser .Visible=true;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;                Object obj = new Object();&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;                browser.Navigate(strPath, ref obj, ref obj, ref obj, ref obj);&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;                //wait until the DHTMLEdit control load the whole document&lt;/div&gt;&lt;div&gt;                for (; browser.Busy != false; )&lt;/div&gt;&lt;div&gt;                {&lt;/div&gt;&lt;div&gt;                    System.Windows.Forms.Application.DoEvents();&lt;/div&gt; &lt;div&gt;                }&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;                mshtml.IHTMLDocument2 doc = browser.Document as mshtml.IHTMLDocument2;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;SHDocVw.OLECMDF cmd = browser.QueryStatusWB( SHDocVw.OLECMDID.OLECMDID_PRINTPREVIEW );&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;//IOleCommandTarget ct = ( IOleCommandTarget ) doc;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;if ( bPrintPreview == true )&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;object pvaIn;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;if ( strPath == string.Empty )&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;						&lt;/span&gt;pvaIn = null;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;}&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;else if ( ! System.IO.File.Exists( strPath ) )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;						&lt;/span&gt;pvaIn = null;&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;else&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;{&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;						&lt;/span&gt;pvaIn = strPath;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;Object pvaout = null;&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;object pv = null;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;object pva = null;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;ie.ExecWB( SHDocVw.OLECMDID.OLECMDID_PRINTPREVIEW, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT, ref&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;pv, ref pva );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;else&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;					&lt;/span&gt;doc.execCommand( &amp;quot;Print&amp;quot;, true, 0 );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;				&lt;/span&gt;}&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif" size="3"&gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: 14px; "&gt;&lt;br&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif" size="3"&gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: 14px;"&gt;&lt;span class="Apple-style-span" style="font-family: arial; font-size: small; line-height: normal; "&gt;&lt;div&gt; &lt;font class="Apple-style-span" face="arial, sans-serif" size="3"&gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: 14px; "&gt;================================&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class="Apple-style-span" face="arial, sans-serif" size="3"&gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: 14px;"&gt;&lt;br&gt; &lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-665993288774169480?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/665993288774169480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2009/10/use-web-browser-control-to-print-and.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/665993288774169480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/665993288774169480'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2009/10/use-web-browser-control-to-print-and.html' title='Use Web Browser control to print and preview a html document'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-1270692049214192679</id><published>2009-09-25T18:36:00.001-07:00</published><updated>2009-09-25T18:36:30.991-07:00</updated><title type='text'>How to create a trigger to insert a record in a backup table when a  record is modified or inserted in one table</title><content type='html'>The following is a quick example that works on SQL Server 7.0&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;set ANSI_NULLS ON&lt;/div&gt;&lt;div&gt;set QUOTED_IDENTIFIER ON&lt;/div&gt;&lt;div&gt;GO&lt;/div&gt;&lt;div&gt;Create TRIGGER [dbo].[trgInsertUpdatePrice]&lt;/div&gt;&lt;div&gt;ON [dbo].[Prices]&lt;/div&gt; &lt;div&gt;After INSERT, Update&lt;/div&gt;&lt;div&gt;AS&lt;/div&gt;&lt;div&gt;        INSERT INTO Prices_log&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;		&lt;/span&gt;select * from Inserted&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-1270692049214192679?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/1270692049214192679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2009/09/how-to-create-trigger-to-insert-record.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/1270692049214192679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/1270692049214192679'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2009/09/how-to-create-trigger-to-insert-record.html' title='How to create a trigger to insert a record in a backup table when a  record is modified or inserted in one table'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-6146287157989669802</id><published>2009-09-24T20:50:00.001-07:00</published><updated>2009-09-24T20:50:46.780-07:00</updated><title type='text'>Open Source Bug track software in ASP.Net</title><content type='html'>&lt;div&gt;I am trying to find some good open source &lt;a href="http://asp.net"&gt;asp.net&lt;/a&gt; bug track software. I found the following article to be a good start point.&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://devpinoy.org/blogs/keithrull/archive/2007/11/02/a-comparisson-of-open-source-bug-tracking-softwares-in-asp-net.aspx"&gt;http://devpinoy.org/blogs/keithrull/archive/2007/11/02/a-comparisson-of-open-source-bug-tracking-softwares-in-asp-net.aspx&lt;/a&gt;&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The following page is the bug &lt;a href="http://track.net"&gt;track.net&lt;/a&gt; page. It is a very nice bug track system.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.ifdefined.com/README.html#connection"&gt;http://www.ifdefined.com/README.html#connection&lt;/a&gt;&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-6146287157989669802?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/6146287157989669802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2009/09/open-source-bug-track-software-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/6146287157989669802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/6146287157989669802'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2009/09/open-source-bug-track-software-in.html' title='Open Source Bug track software in ASP.Net'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-2472749795063524248</id><published>2009-09-22T09:44:00.001-07:00</published><updated>2009-09-22T09:44:58.593-07:00</updated><title type='text'>How to trace down memory leakage in C++ code</title><content type='html'>&lt;div&gt;Following link provide a good method.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/4wth1ha5(VS.80).aspx"&gt;http://msdn.microsoft.com/en-us/library/4wth1ha5(VS.80).aspx&lt;/a&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;For example, if following memory leaks were detected: (Check the output window of VS after you close application in debug mode)&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;Detected memory leaks!&lt;/div&gt;&lt;div&gt;Dumping objects -&amp;gt;&lt;/div&gt;&lt;div&gt;f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(141) : {214137} normal block at 0x06C6B2B8, 42 bytes long.&lt;/div&gt;&lt;div&gt; Data: &amp;lt;, ?x            &amp;gt; 2C 08 3F 78 19 00 00 00 19 00 00 00 01 00 00 00 &lt;/div&gt; &lt;div&gt;f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(141) : {214136} normal block at 0x06C6B3A8, 91 bytes long.&lt;/div&gt;&lt;div&gt; Data: &amp;lt;, ?xJ   J       &amp;gt; 2C 08 3F 78 4A 00 00 00 4A 00 00 00 01 00 00 00 &lt;/div&gt;&lt;div&gt;f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(141) : {214116} normal block at 0x06C6B258, 30 bytes long.&lt;/div&gt; &lt;div&gt; Data: &amp;lt;, ?x            &amp;gt; 2C 08 3F 78 0D 00 00 00 0D 00 00 00 01 00 00 00 &lt;/div&gt;&lt;div&gt;{214115} normal block at 0x06C6B208, 20 bytes long.&lt;/div&gt;&lt;div&gt; Data: &amp;lt;                &amp;gt; B0 AA C6 06 00 AD C6 06 B0 A9 C6 06 00 AE C6 06 &lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/4wth1ha5(VS.80).aspx"&gt;&lt;/a&gt;You can put following code at the start of the application. Make sure it is called before the allocation happened. &lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;int allocateNo = 214137;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;_CrtSetBreakAlloc(allocateNo);&lt;/div&gt;&lt;div&gt; _crtBreakAlloc = allocateNo;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;allocateNo = 214136;&lt;/div&gt; &lt;div&gt;&lt;div&gt;_CrtSetBreakAlloc(allocateNo);&lt;/div&gt;&lt;div&gt; _crtBreakAlloc = allocateNo;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;allocateNo = 214116;&lt;/div&gt; &lt;div&gt;&lt;div&gt;_CrtSetBreakAlloc(allocateNo);&lt;/div&gt;&lt;div&gt; _crtBreakAlloc = allocateNo;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;allocateNo = 214115;&lt;/div&gt;&lt;div&gt;&lt;div&gt;_CrtSetBreakAlloc(allocateNo);&lt;/div&gt;&lt;div&gt; _crtBreakAlloc = allocateNo;&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Now when you start application in debug mode, VS will break when the memory that is not properly freed is allocated and you will be able to trace down the object that need to be properly handled.&lt;/div&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-2472749795063524248?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/2472749795063524248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2009/09/how-to-trace-down-memory-leakage-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/2472749795063524248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/2472749795063524248'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2009/09/how-to-trace-down-memory-leakage-in-c.html' title='How to trace down memory leakage in C++ code'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-5205472890493117182</id><published>2009-07-23T09:45:00.001-07:00</published><updated>2009-07-23T09:45:11.419-07:00</updated><title type='text'>webbrowser control DocumentCompleted triggered multiple times</title><content type='html'>&lt;div&gt;I am struggling with the documentCompleted event of web browser control for quite a little while.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;There are many posts about how to decide whether the whole page has been loaded. Unfortunately none of them worked.&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The following is one sample.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://codinghut.com/2008/08/how-to-tell-when-a-webbrowser-has-fully-loaded-the-final-answer/"&gt;http://codinghut.com/2008/08/how-to-tell-when-a-webbrowser-has-fully-loaded-the-final-answer/&lt;/a&gt;&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;With following page, the event has never been triggered with the parameter url equals to the browser url.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.canadiantire.ca/browse/product_detail.jsp?PRODUCT"&gt;http://www.canadiantire.ca/browse/product_detail.jsp?PRODUCT&lt;/a&gt;&amp;lt;&amp;gt;prd_id=845524441893435&amp;amp;FOLDER&amp;lt;&amp;gt;folder_id=1408474396672077&amp;amp;bmUID=1230691825032&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Some people suggest to use a indes in the control navigating event because everytime a new document downloading will trigger the navigating event. However,&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The indicator never reaches 0 if you add one to the index in navigating event and minus 1 in the document completed event.&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I have also tried the browser ready state and check whether the browser has a ready state equal to Complete.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;        private void timer1_Tick(object sender, EventArgs e)&lt;/div&gt;&lt;div&gt;         {&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;            if (webBrowser1.ReadyState == WebBrowserReadyState.Complete)&lt;/div&gt;&lt;div&gt;            {&lt;/div&gt;&lt;div&gt;                ... &lt;span class="Apple-tab-span" style="white-space:pre"&gt;	&lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;                timer1.Stop();&lt;/div&gt;&lt;div&gt;            }&lt;/div&gt;&lt;div&gt;        }&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;for the above web page, the ready state changed from Uninitialized to downloading and the interactive and stays as interactive forever.&lt;/div&gt; &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;So far I have not found a valid way to detect whether a page has been fully loaded.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-5205472890493117182?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/5205472890493117182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2009/07/webbrowser-control-documentcompleted.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/5205472890493117182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/5205472890493117182'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2009/07/webbrowser-control-documentcompleted.html' title='webbrowser control DocumentCompleted triggered multiple times'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-3857430173650535421</id><published>2009-07-16T12:34:00.001-07:00</published><updated>2009-07-17T07:41:47.492-07:00</updated><title type='text'>Cross-thread Operation Not Valid</title><content type='html'>I am working on a problem that UI response is very slow because the application has to initialize a collection of very complex grid view and the process will take as long as 8 seconds. I am trying to create another thread to initialize the grid views in a parallel thread. Then I came across the problem of cross thread operation not valid error because .Net does not allow the form controls to be updated in a thread other than the thread to create it.&lt;br /&gt;&lt;br /&gt;The following is a solution that I can found from web.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.astahost.com/info.php/Needed-Cross-thread-Operation-Valid_t15008.html"&gt;http://www.astahost.com/info.php/Needed-Cross-thread-Operation-Valid_t15008.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;However, I noticed that even I can remove the exception, I can not solve the problem of performance because the time consuming operation is still executed in the main thread with invoke.&lt;br /&gt;&lt;br /&gt;The following is the code.&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.ComponentModel;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Drawing;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Text;&lt;br /&gt;using System.Windows.Forms;&lt;br /&gt;using System.Timers;&lt;br /&gt;&lt;br /&gt;namespace UIThread&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;    class SampleThread&lt;br /&gt;    {&lt;br /&gt;        public delegate void TestEventHandler(string sParameter);&lt;br /&gt;        public event TestEventHandler TestEvent;&lt;br /&gt;&lt;br /&gt;        protected System.Timers.Timer TestTimer = new System.Timers.Timer();&lt;br /&gt;        protected ISynchronizeInvoke SyncObject;&lt;br /&gt;&lt;br /&gt;        public SampleThread(ISynchronizeInvoke SyncObject)&lt;br /&gt;        {&lt;br /&gt;            this.SyncObject = SyncObject;&lt;br /&gt;            TestTimer.Elapsed += new ElapsedEventHandler(Tick);&lt;br /&gt;            TestTimer.Interval = 300;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        protected delegate void TickDelegate(object source, ElapsedEventArgs e);&lt;br /&gt;        private void Tick(object source, ElapsedEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            if (SyncObject.InvokeRequired)&lt;br /&gt;            {&lt;br /&gt;                SyncObject.BeginInvoke(new TickDelegate(Tick), new object[] { source, e });&lt;br /&gt;&lt;br /&gt;                //the following funciton are executed in the parellel thread&lt;br /&gt;                string sParameter = "";&lt;br /&gt;                for (int i = 0; i &amp;lt; 2000000; i++)&lt;br /&gt;                {&lt;br /&gt;                    sParameter = sParameter + (i * i * i).ToString();&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;            else&lt;br /&gt;            {&lt;br /&gt;                TestEvent(DateTime.Now.ToString());&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public void Go()&lt;br /&gt;        {&lt;br /&gt;            TestTimer.Enabled = true;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    public partial class Form1 : Form&lt;br /&gt;    {&lt;br /&gt;        SampleThread sampleThread;&lt;br /&gt;&lt;br /&gt;        public Form1()&lt;br /&gt;        {&lt;br /&gt;            InitializeComponent();&lt;br /&gt;            sampleThread = new SampleThread(this);&lt;br /&gt;            sampleThread.TestEvent += new SampleThread.TestEventHandler(FunctionInMainThread);&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        void FunctionInMainThread(string sParameter)&lt;br /&gt;        {&lt;br /&gt;            //basically this funciton is called from other thread by executed in main thread.&lt;br /&gt;            this.Text = sParameter;&lt;br /&gt;&lt;br /&gt;            //If following lines are turned on, the UI will become very slow in response.&lt;br /&gt;            //for (int i = 0; i &amp;lt; 2000000; i++)&lt;br /&gt;            //{&lt;br /&gt;            //    sParameter = sParameter + (i * i * i).ToString();&lt;br /&gt;            //}&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        private void Form1_Load(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            sampleThread.Go();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-3857430173650535421?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/3857430173650535421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2009/07/cross-thread-operation-not-valid.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/3857430173650535421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/3857430173650535421'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2009/07/cross-thread-operation-not-valid.html' title='Cross-thread Operation Not Valid'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-3995484892653268046</id><published>2009-07-03T08:22:00.001-07:00</published><updated>2009-07-03T08:22:37.245-07:00</updated><title type='text'>Communication between managed c++ dll and C# form application</title><content type='html'>&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;&lt;meta name="ProgId" content="Word.Document"&gt;&lt;meta name="Generator" content="Microsoft Word 12"&gt;&lt;meta name="Originator" content="Microsoft Word 12"&gt;&lt;link rel="File-List" href="file:///C:%5CDOCUME%7E1%5Chouzhip%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_filelist.xml"&gt;&lt;link rel="themeData" href="file:///C:%5CDOCUME%7E1%5Chouzhip%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_themedata.thmx"&gt;&lt;link rel="colorSchemeMapping" href="file:///C:%5CDOCUME%7E1%5Chouzhip%5CLOCALS%7E1%5CTemp%5Cmsohtmlclip1%5C01%5Cclip_colorschememapping.xml"&gt;&lt;style&gt; &lt;!--  /* Font Definitions */  @font-face 	{font-family:SimSun; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-alt:宋体; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;} @font-face 	{font-family:"Cambria Math"; 	panose-1:2 4 5 3 5 4 6 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:roman; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1107304683 0 0 159 0;} @font-face 	{font-family:Calibri; 	panose-1:2 15 5 2 2 2 4 3 2 4; 	mso-font-charset:0; 	mso-generic-font-family:swiss; 	mso-font-pitch:variable; 	mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face 	{font-family:"\@SimSun"; 	panose-1:2 1 6 0 3 1 1 1 1 1; 	mso-font-charset:134; 	mso-generic-font-family:auto; 	mso-font-pitch:variable; 	mso-font-signature:3 135135232 16 0 262145 0;}  /* Style Definitions */  p.MsoNormal, li.MsoNormal, div.MsoNormal 	{mso-style-unhide:no; 	mso-style-qformat:yes; 	mso-style-parent:""; 	margin-top:0cm; 	margin-right:0cm; 	margin-bottom:10.0pt; 	margin-left:0cm; 	line-height:115%; 	mso-pagination:widow-orphan; 	font-size:11.0pt; 	font-family:"Calibri","sans-serif"; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:SimSun; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoChpDefault 	{mso-style-type:export-only; 	mso-default-props:yes; 	mso-ascii-font-family:Calibri; 	mso-ascii-theme-font:minor-latin; 	mso-fareast-font-family:SimSun; 	mso-fareast-theme-font:minor-fareast; 	mso-hansi-font-family:Calibri; 	mso-hansi-theme-font:minor-latin; 	mso-bidi-font-family:"Times New Roman"; 	mso-bidi-theme-font:minor-bidi;} .MsoPapDefault 	{mso-style-type:export-only; 	margin-bottom:10.0pt; 	line-height:115%;} @page Section1 	{size:612.0pt 792.0pt; 	margin:72.0pt 72.0pt 72.0pt 72.0pt; 	mso-header-margin:35.4pt; 	mso-footer-margin:35.4pt; 	mso-paper-source:0;} div.Section1 	{page:Section1;} --&gt; &lt;/style&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="" lang="EN-US"&gt;Step 1:&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="" lang="EN-US"&gt;Create a new C++ dynamic library project by default and name it as MCDLL. The default class will be as following. &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="" lang="EN-US"&gt;First file:&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;"&gt;// MCDll.h&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;#pragma&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: blue;"&gt;once&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: blue;"&gt;namespace&lt;/span&gt; System;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;namespace&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; MCDll {&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;ref&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; Class1&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;span style="color: green;"&gt;// TODO: Add your methods for this class here.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;};&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="" lang="EN-US"&gt;Second file:&lt;/span&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;; color: green;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;"&gt;// This is the main DLL file.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;#include&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;stdafx.h&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(163, 21, 21);"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;#include&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;MCDll.h&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(163, 21, 21);"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(163, 21, 21);"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="" lang="EN-US"&gt;Step 2: &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="" lang="EN-US"&gt;Now we can add a class in the empty dll as following&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;"&gt;// MCDll.h&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;#pragma&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: blue;"&gt;once&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: blue;"&gt;namespace&lt;/span&gt; System;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;namespace&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; MCDll {&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;ref&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; Class1&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;span style="color: green;"&gt;// TODO: Add your methods for this class here.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;:&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;&amp;gt;^ m_adTestArray;&lt;span style=""&gt;     &lt;/span&gt;&lt;span style="color: green;"&gt;// array that can be passed to C#&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;span style="color: green;"&gt;//function to return double array&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;&amp;gt;^ GetTestArray(&lt;span style="color: blue;"&gt;int&lt;/span&gt; iLength);&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;};&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="" lang="EN-US"&gt;Second file:&lt;/span&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;; color: green;"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;"&gt;// This is the main DLL file.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;#include&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;stdafx.h&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(163, 21, 21);"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;#include&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;MCDll.h&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(163, 21, 21);"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;array&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;lt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;&amp;gt;^ &lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;MCDll::&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;Class1::&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;GetTestArray(&lt;span style="color: blue;"&gt;int&lt;/span&gt; iLength)&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;m_adTestArray = &lt;span style="color: blue;"&gt;gcnew&lt;/span&gt; &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;&amp;gt;(iLength);&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;(&lt;span style="color: blue;"&gt;int&lt;/span&gt; i=0;i&amp;lt;iLength;i++)&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;m_adTestArray[i] = i*i*i;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt; m_adTestArray;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt;}&lt;/span&gt;&lt;span style="font-size: 8pt; line-height: 115%;" lang="EN-US"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="" lang="EN-US"&gt;Compile the MCDLL project and &lt;span style=""&gt; &lt;/span&gt;you will see how it works.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="" lang="EN-US"&gt;Step 3: &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="" lang="EN-US"&gt;Now we can create a simple window Form application with C#, and the project MCDll as a project reference to our C# form application in order to access the function defined in C++.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="" lang="EN-US"&gt;The following is a simple code to demo the use of the c++ class.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="" lang="EN-US"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; System;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; System.Collections.Generic;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; System.ComponentModel;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; System.Data;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; System.Drawing;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; System.Text;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; System.Windows.Forms;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;namespace&lt;/span&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; CSApp&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;      &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;partial&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Form1&lt;/span&gt; : &lt;span style="color: rgb(43, 145, 175);"&gt;Form&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;      &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; Form1()&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;            &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                  &lt;/span&gt;InitializeComponent();&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;            &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; button1_Click( &lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: rgb(43, 145, 175);"&gt;EventArgs&lt;/span&gt; e )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;            &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                  &lt;/span&gt;MCDll.&lt;span style="color: rgb(43, 145, 175);"&gt;Class1&lt;/span&gt; class1 = &lt;span style="color: blue;"&gt;new&lt;/span&gt; MCDll.&lt;span style="color: rgb(43, 145, 175);"&gt;Class1&lt;/span&gt;();&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                  &lt;/span&gt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;[] adFromC = &lt;span style="color: blue;"&gt;null&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                  &lt;/span&gt;adFromC = class1.GetTestArray( 5 );&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                  &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt; ( &lt;span style="color: blue;"&gt;int&lt;/span&gt; i = 0; i &amp;lt; adFromC.Length; i++ )&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                  &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                        &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine( adFromC[ i ].ToString() );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                  &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;            &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;      &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt;Compile above application and execute it, we will see that the double array is initialized in C++ dll but is accessible from C# application.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt;A few more cases are demoed here to show how to pass parameters by reference, how to return a dimensional array back and how to return a string array. Full code can be found at following&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;"&gt;// MCDll.h&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;#pragma&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: blue;"&gt;once&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;using&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: blue;"&gt;namespace&lt;/span&gt; System;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;namespace&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; MCDll {&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;ref&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; Class1&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;span style="color: green;"&gt;// TODO: Add your methods for this class here.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt;:&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;&amp;gt;^ m_adTestArray;&lt;span style=""&gt;     &lt;/span&gt;&lt;span style="color: green;"&gt;// array that can be passed to C#&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;,3&amp;gt;^ m_adDimensionalArray;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt;:&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;span style="color: green;"&gt;//function to return double array&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;&amp;gt;^ GetTestArray(&lt;span style="color: blue;"&gt;int&lt;/span&gt; iLength);&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;span style="color: green;"&gt;//funciton to return a string array&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt;System::String^&amp;gt;^ GetTestStringArray( &lt;span style="color: blue;"&gt;int&lt;/span&gt; iLength );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;span style="color: green;"&gt;//function to return double array with dimension&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;,3&amp;gt;^ GetMultiDimensionArray(&lt;span style="color: blue;"&gt;int&lt;/span&gt; iLength);&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;span style="color: green;"&gt;//pass parameter by reference&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;PassParameterByReference( &lt;span style="color: blue;"&gt;double&lt;/span&gt; dInput, &lt;span style="color: blue;"&gt;double&lt;/span&gt;% dOutput1, &lt;span style="color: blue;"&gt;double&lt;/span&gt;% dOutput2);&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;span style="color: green;"&gt;//pass parameter by reference&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;&lt;span style=""&gt;  &lt;/span&gt;PassParameterByReference2( &lt;span style="color: blue;"&gt;double&lt;/span&gt; dInput, &lt;span style="color: blue;"&gt;double&lt;/span&gt;% dOutput1, &lt;span style="color: blue;"&gt;double&lt;/span&gt;% dOutput2);&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;};&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;"&gt;// This is the main DLL file.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;#include&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;stdafx.h&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(163, 21, 21);"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;#include&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;MCDll.h&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(163, 21, 21);"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;array&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;lt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;&amp;gt;^ &lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;MCDll::&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;Class1::&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;GetTestArray(&lt;span style="color: blue;"&gt;int&lt;/span&gt; iLength)&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;m_adTestArray = &lt;span style="color: blue;"&gt;gcnew&lt;/span&gt; &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;&amp;gt;(iLength);&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;(&lt;span style="color: blue;"&gt;int&lt;/span&gt; i=0;i&amp;lt;iLength;i++)&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;m_adTestArray[i] = i*i*i;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt; m_adTestArray;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;array&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;lt;System::String^&amp;gt;^&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;MCDll::&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;Class1::&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;GetTestStringArray(&lt;span style="color: blue;"&gt;int&lt;/span&gt; iLength )&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt;System::String^&amp;gt;^ astrArray = &lt;span style="color: blue;"&gt;gcnew&lt;/span&gt; &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt;System::String^&amp;gt;(iLength);&lt;span style=""&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt; ( &lt;span style="color: blue;"&gt;int&lt;/span&gt; i = 0; i &amp;lt; iLength; i++ )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;System::String^ str;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;str = &lt;span style="color: blue;"&gt;gcnew&lt;/span&gt; System::String( i.ToString() );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;astrArray[i] = str;&lt;span style=""&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt; astrArray;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;array&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&amp;lt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;, 3&amp;gt;^ &lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;MCDll::&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;Class1::&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;GetMultiDimensionArray(&lt;span style="color: blue;"&gt;int&lt;/span&gt; iLength )&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;m_adDimensionalArray = &lt;span style="color: blue;"&gt;gcnew&lt;/span&gt; &lt;span style="color: blue;"&gt;array&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;,3&amp;gt;(iLength, iLength, iLength);&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;(&lt;span style="color: blue;"&gt;int&lt;/span&gt; i=0;i&amp;lt;iLength;i++)&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;(&lt;span style="color: blue;"&gt;int&lt;/span&gt; j=0;j&amp;lt;iLength;j++)&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt;(&lt;span style="color: blue;"&gt;int&lt;/span&gt; k=0;k&amp;lt;iLength;k++)&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                           &lt;/span&gt;m_adDimensionalArray[i,j,k]=i*100+j*10+k;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt; m_adDimensionalArray;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;"&gt;// pass parameters by reference&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;double&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;MCDll::&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;Class1::&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;PassParameterByReference( &lt;span style="color: blue;"&gt;double&lt;/span&gt; dInput, &lt;span style="color: blue;"&gt;double&lt;/span&gt;% dOutput1, &lt;span style="color: blue;"&gt;double&lt;/span&gt;% dOutput2)&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;dOutput1 =dInput * dInput;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;dOutput2 =dInput * dInput *2;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt; PassParameterByReference2(dInput,dOutput1,dOutput2);&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: green;"&gt;// pass parameters by reference and called&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;; color: blue;"&gt;double&lt;/span&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;MCDll::&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;Class1::&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;PassParameterByReference2( &lt;span style="color: blue;"&gt;double&lt;/span&gt; dInput, &lt;span style="color: blue;"&gt;double&lt;/span&gt;% dOutput1, &lt;span style="color: blue;"&gt;double&lt;/span&gt;% dOutput2)&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;dOutput1 =dInput * dInput * dInput;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;dOutput2 =dInput * dInput * dInput*2 ;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style="color: blue;"&gt;return&lt;/span&gt; dOutput2 *2;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt;The following code shows how to call the dll functions.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; TestFunctions()&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;MCDll.&lt;span style="color: rgb(43, 145, 175);"&gt;Class1&lt;/span&gt; class1 = &lt;span style="color: blue;"&gt;new&lt;/span&gt; MCDll.&lt;span style="color: rgb(43, 145, 175);"&gt;Class1&lt;/span&gt;();&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;[] adFromC = &lt;span style="color: blue;"&gt;null&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;adFromC = class1.GetTestArray( 5 );&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt; ( &lt;span style="color: blue;"&gt;int&lt;/span&gt; i = 0; i &amp;lt; adFromC.Length; i++ )&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                           &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine( adFromC[ i ].ToString() );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;[] astrArray = class1.GetTestStringArray( 10 );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt; ( &lt;span style="color: blue;"&gt;int&lt;/span&gt; i = 0; i &amp;lt; astrArray.Length; i++ )&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                           &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine( astrArray[ i ] );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;&lt;span style="color: blue;"&gt;int&lt;/span&gt; iLength = 5;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;&lt;span style="color: blue;"&gt;double&lt;/span&gt;[ , , ] adDimensionArray = class1.GetMultiDimensionArray( iLength );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt; ( &lt;span style="color: blue;"&gt;int&lt;/span&gt; i = 0; i &amp;lt; iLength; i++ )&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                           &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt; ( &lt;span style="color: blue;"&gt;int&lt;/span&gt; j = 0; j &amp;lt; iLength; j++ )&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                           &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                                  &lt;/span&gt;&lt;span style="color: blue;"&gt;for&lt;/span&gt; ( &lt;span style="color: blue;"&gt;int&lt;/span&gt; k = 0; k &amp;lt; iLength; k++ )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                                  &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                                         &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.Write( adDimensionArray[ i, j, k ] );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                                         &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.Write( &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;\t&amp;quot;&lt;/span&gt; );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                                  &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                                  &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.Write( &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;\n&amp;quot;&lt;/span&gt; );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                           &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                           &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.Write( &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;\n&amp;quot;&lt;/span&gt; );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;&lt;span style="color: blue;"&gt;double&lt;/span&gt; dInput = 3.0;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;&lt;span style="color: blue;"&gt;double&lt;/span&gt; dOutput1 = 0;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;&lt;span style="color: blue;"&gt;double&lt;/span&gt; dOutput2 = 0;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                    &lt;/span&gt;&lt;span style="color: blue;"&gt;double&lt;/span&gt; dReturn = class1.PassParameterByReference( dInput, &lt;span style="color: blue;"&gt;ref&lt;/span&gt; dOutput1, &lt;span style="color: blue;"&gt;ref&lt;/span&gt; dOutput2 );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine( &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;Input: &amp;quot;&lt;/span&gt; + dInput.ToString() );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine( &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;dOutput1: &amp;quot;&lt;/span&gt; + dOutput1.ToString() );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine( &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;dOutput2: &amp;quot;&lt;/span&gt; + dOutput2.ToString() );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style="font-size: 8pt; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;                     &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine( &lt;span style="color: rgb(163, 21, 21);"&gt;&amp;quot;dReturn: &amp;quot;&lt;/span&gt; + dReturn.ToString() );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 8pt; line-height: 115%; font-family: &amp;quot;Courier New&amp;quot;;"&gt;&lt;span style=""&gt;              &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-3995484892653268046?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/3995484892653268046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2009/07/communication-between-managed-c-dll-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/3995484892653268046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/3995484892653268046'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2009/07/communication-between-managed-c-dll-and.html' title='Communication between managed c++ dll and C# form application'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-3181893756169418579</id><published>2009-07-02T12:43:00.001-07:00</published><updated>2009-07-17T07:48:20.581-07:00</updated><title type='text'>Use the free REST web service to extact geo information from IP  address</title><content type='html'>The following sample provides a class to extract geo information from any IP address using a completely free web service provided by &lt;a href="http://www.ipinfodb.com/"&gt;www.IPInfoDB.com&lt;/a&gt;.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is the code for a simple windows form application in C#. The class IPInfor will construct itself from an IP address and return available attributes as properties.&lt;/div&gt; &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;using System;&lt;/div&gt;&lt;div&gt;using System.Collections.Generic;&lt;/div&gt;&lt;div&gt;using System.ComponentModel;&lt;/div&gt;&lt;div&gt;using System.Data;&lt;/div&gt;&lt;div&gt;using System.Drawing;&lt;/div&gt;&lt;div&gt;using System.Text;&lt;/div&gt; &lt;div&gt;using System.Windows.Forms;&lt;/div&gt;&lt;div&gt;using System.IO;&lt;/div&gt;&lt;div&gt;using System.Net;&lt;/div&gt;&lt;div&gt;using System.Xml;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;namespace test&lt;/div&gt;&lt;div&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;public partial class Form1 : Form&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;public Form1()&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;{&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;InitializeComponent();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;/// &amp;lt;summary&amp;gt;&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;/// A class respresent the data structure from IPInfoDB REST web service&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;/// &amp;lt;/summary&amp;gt;&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;public class IPInfor &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;private string m_sIP;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;private string m_sCountryCode;&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;private string m_sCountryName;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;private string m_sRegionCode;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;private string m_sRegionName;&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;private string m_sCityName;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;private string m_sZipPostCode;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;private double m_dLatitude;&lt;/div&gt; &lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;private double m_dLongigitude;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;private double m_dGmtoffset;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;private double m_dDstoffset;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;public string IP&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;get&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;return m_sIP;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;public string CountryCode&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;get&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;return m_sCountryCode;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;public string CountryName&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;get&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;return m_sCountryName;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;public string RegionCode&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;get&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;return m_sRegionCode;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;public string RegionName&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;get&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;return m_sRegionName;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;public string CityName&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;get&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;return m_sCityName;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;public string ZipPostCode&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;get&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;return m_sZipPostCode;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;public double Latitude&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;get&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;return m_dLatitude;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;public double Longigitude&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;get&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;return m_dLongigitude;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;public double Gmtoffset&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;get&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;return m_dGmtoffset;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;public double Dstoffset&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;get&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;return m_dDstoffset;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;/// &lt;summary&gt;&lt;/summary&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;/// return the orignal REST response returned by "http://ipinfodb.com/ip_query.php?ip=" + sIP;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;/// &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;/// &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;/// &lt;returns&gt;the original response string from web service based on the &lt;/returns&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;private static string ShowOriginalResponse( StreamReader streamReader, bool bNoTranslation )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;//directly return it;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;if ( bNoTranslation == true )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;{ &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;return streamReader.ReadToEnd();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;using ( XmlTextReader reader = new XmlTextReader( streamReader ) )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;StringBuilder sb = new StringBuilder();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;sb.Append( "\n ================ Start ===========\n" );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;while ( reader.Read() )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;switch ( reader.NodeType )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;       &lt;/span&gt;case XmlNodeType.Element: // The node is an Element.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;sb.Append( "&lt;" + reader.Name );&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;while ( reader.MoveToNextAttribute() ) // Read attributes.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;sb.Append( " " + reader.Name + "='" + reader.Value + "'" );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;sb.Append( "&gt;" );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;sb.Append( "&gt;\n" );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;       &lt;/span&gt;case XmlNodeType.Text: //Display the text in each element.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;sb.Append( reader.Value );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;sb.Append( "\n" );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;       &lt;/span&gt;case XmlNodeType.EndElement: //Display end of element.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;sb.Append( "&lt;"+"/" + reader.Name );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;sb.Append( "&gt;\n" );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;sb.Append( "\n ================ End ===========\n" );&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;return sb.ToString();&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;//extract REST response to the IPInfor data structure&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;private void GetDataFromStreamReader( StreamReader streamReader )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;XmlTextReader reader = new XmlTextReader( streamReader );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;string sCurrentName = "";&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;while ( reader.Read() )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;switch ( reader.NodeType )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;case XmlNodeType.Element: // The node is an Element.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;       &lt;/span&gt;while ( reader.MoveToNextAttribute() )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;       &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;       &lt;/span&gt;}// Read attributes.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;       &lt;/span&gt;sCurrentName = reader.Name;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;       &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;case XmlNodeType.Text: //Display the text in each element.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;       &lt;/span&gt;switch ( sCurrentName )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;       &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;case "Ip":&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;m_sIP = reader.Value;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;case "CountryCode":&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;m_sCountryCode = reader.Value;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;case "CountryName":&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;m_sCountryName = reader.Value;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;case "RegionCode":&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;m_sRegionCode = reader.Value;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;case "RegionName":&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;m_sRegionName = reader.Value;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;case "City":&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;m_sCityName = reader.Value;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;case "ZipPostalCode":&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;m_sZipPostCode = reader.Value;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;case "Latitude":&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;try&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;          &lt;/span&gt;m_dLatitude = Convert.ToDouble( reader.Value );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;catch ( Exception eee )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;          &lt;/span&gt;m_dLatitude = 0;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;case "Longitude":&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;try&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;          &lt;/span&gt;m_dLongigitude = Convert.ToDouble( reader.Value );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;catch ( Exception eee )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;          &lt;/span&gt;m_dLongigitude = 0;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;case "Gmtoffset":&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;try&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;          &lt;/span&gt;m_dGmtoffset = Convert.ToDouble( reader.Value );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;catch ( Exception eee )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;          &lt;/span&gt;m_dGmtoffset = 0;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;case "Dstoffset":&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;try&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;          &lt;/span&gt;m_dDstoffset = Convert.ToDouble( reader.Value );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;catch ( Exception eee )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;          &lt;/span&gt;m_dDstoffset = 0;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;        &lt;/span&gt;default:&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;         &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;       &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;       &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;case XmlNodeType.EndElement: //Display end of element.&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;       &lt;/span&gt;break;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;//default constructor&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;public IPInfor()&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;//get original REST response from &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;public static string ShowOriginalResponse( string sIP, bool bNoTranslation )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;try&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;string sQueryMain = "http://ipinfodb.com/ip_query.php?ip=" + sIP;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;HttpWebRequest request = WebRequest.Create( sQueryMain ) as HttpWebRequest;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;// Get response  &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;using ( HttpWebResponse response = request.GetResponse() as HttpWebResponse )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;// Get the response stream  &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;StreamReader reader = new StreamReader( response.GetResponseStream() );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;return ShowOriginalResponse( reader, bNoTranslation );&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;catch ( Exception eee )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;//using backup service&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;string sQueryBackup = "http://backup.ipinfodb.com/ip_query.php?ip=" + sIP;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;HttpWebRequest request = WebRequest.Create( sQueryBackup ) as HttpWebRequest;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;// Get response  &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;using ( HttpWebResponse response = request.GetResponse() as HttpWebResponse )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;// Get the response stream  &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;StreamReader reader = new StreamReader( response.GetResponseStream() );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;return ShowOriginalResponse( reader, bNoTranslation );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;//contruct an IPInfor class from IP address using REST web service from IPInforDB&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;public IPInfor( string sIP )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;try&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;string sQueryMain = "http://ipinfodb.com/ip_query.php?ip=" + sIP;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;HttpWebRequest request = WebRequest.Create( sQueryMain ) as HttpWebRequest;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;// Get response  &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;using ( HttpWebResponse response = request.GetResponse() as HttpWebResponse )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;// Get the response stream  &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;StreamReader reader = new StreamReader( response.GetResponseStream() );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;GetDataFromStreamReader( reader );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;catch ( Exception eee )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;//using backup service&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;string sQueryBackup = "http://backup.ipinfodb.com/ip_query.php?ip=" + sIP;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;HttpWebRequest request = WebRequest.Create( sQueryBackup ) as HttpWebRequest;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;// Get response  &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;using ( HttpWebResponse response = request.GetResponse() as HttpWebResponse )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;// Get the response stream  &lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;StreamReader reader = new StreamReader( response.GetResponseStream() );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;GetDataFromStreamReader( reader );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;      &lt;/span&gt;return;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;     &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;}&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;private void button1_Click( object sender, EventArgs e )&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;//us ip&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;//string sIP = "74.125.45.100";&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;string sIP = "202.90.224.90"; //china ip http://www.adsensepublish.com/china-ip-address.html&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;sIP = "217.8.101.90"; //china ip http://www.adsensepublish.com/china-ip-address.html&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;sIP = "219.242.247.90"; //china ip http://www.adsensepublish.com/china-ip-address.html&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;sIP = "59.107.0.127"; //china ip http://www.adsensepublish.com/china-ip-address.html&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;//local ip&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;//string sIP = "";&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;string sQueryMain = "http://ipinfodb.com/ip_query.php?ip=" + sIP;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;string sQueryBackup = "http://backup.ipinfodb.com/ip_query.php?ip=" + sIP;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;Console.Write( IPInfor.ShowOriginalResponse( sIP, true ) );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;//Console.Write( IPInfor.ShowOriginalResponse( sIP, false ) );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;IPInfor ipInfo = new IPInfor( sIP );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;Console.WriteLine( ipInfo.IP );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;Console.WriteLine( ipInfo.CountryName );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;Console.WriteLine( ipInfo.CountryCode );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;Console.WriteLine( ipInfo.RegionName );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;Console.WriteLine( ipInfo.RegionCode );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;Console.WriteLine( ipInfo.CityName);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;Console.WriteLine( ipInfo.Latitude );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;Console.WriteLine( ipInfo.Longigitude);&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;Console.WriteLine( ipInfo.ZipPostCode );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;Console.WriteLine( ipInfo.Gmtoffset );&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;Console.WriteLine( ipInfo.Dstoffset);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt; &lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-3181893756169418579?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/3181893756169418579/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2009/07/use-free-rest-web-service-to-extact-geo.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/3181893756169418579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/3181893756169418579'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2009/07/use-free-rest-web-service-to-extact-geo.html' title='Use the free REST web service to extact geo information from IP  address'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-6457926116110588828</id><published>2009-06-06T20:08:00.001-07:00</published><updated>2009-06-06T20:08:32.032-07:00</updated><title type='text'>set a column of a table equal to the lower case of another column in  SQL Server</title><content type='html'>You can use following sql script to perform the above task.&lt;p&gt;In Query editor of SQL Server Management Studio, type in following command,&lt;p&gt;update users set lowerCase = lower(Username)&lt;p&gt;click execute.&lt;p&gt;The column of lowerCase will be set to lower case of the Username&lt;br&gt;column for each row in in table users.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-6457926116110588828?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/6457926116110588828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2009/06/set-column-of-table-equal-to-lower-case.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/6457926116110588828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/6457926116110588828'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2009/06/set-column-of-table-equal-to-lower-case.html' title='set a column of a table equal to the lower case of another column in  SQL Server'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-6352425552744051005</id><published>2009-06-05T12:26:00.001-07:00</published><updated>2009-06-05T12:26:35.420-07:00</updated><title type='text'>Layered 2D drawing using GDI+ and C#</title><content type='html'>&lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Sometimes we want store each layer of object in memory and does not refresh them always. Instead, we will only redraw the layers that we need to redraw, and compose the final drawing with existing bitmaps in memory.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;Following sample shows how to draw multi layers on one control.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font face="Calibri" size="3"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Steps:&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoListParagraphCxSpFirst" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font face="Calibri" size="3"&gt;1.&lt;/font&gt;&lt;span style="FONT: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Create a windows form application using C# in visual studio 2005&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font face="Calibri" size="3"&gt;2.&lt;/font&gt;&lt;span style="FONT: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Draw a panel control to Form1. Rename the panel name to panelDrawing.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font face="Calibri" size="3"&gt;3.&lt;/font&gt;&lt;span style="FONT: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Replace the Form1 class with following code.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font face="Calibri" size="3"&gt;4.&lt;/font&gt;&lt;span style="FONT: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font face="Calibri" size="3"&gt;Link the OnPaint event of the panel to event &lt;/font&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;panelDrawing_Paint&lt;/span&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpLast" style="MARGIN: 0cm 0cm 10pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font face="Calibri" size="3"&gt;5.&lt;/font&gt;&lt;span style="FONT: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Compile and run.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;You will see that the final image we have actually comes from three different layers. If we add a button to update only second layer, we will end up with much faster drawing effect. The disadvantage of this method is that it requires a lot of memory to store each layer, especially when the view area is big.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font face="Calibri" size="3"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;      &lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;partial&lt;/span&gt; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Form1&lt;/span&gt; : &lt;span style="COLOR: #2b91af"&gt;Form&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;      &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt; iBitMapWidth = 1024;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt; iBitMapHeight = 1024;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Bitmap&lt;/span&gt; btmap;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Bitmap&lt;/span&gt; btmapLayer2;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Bitmap&lt;/span&gt; btmapLayer3;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; Form1()&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;InitializeComponent();&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;btmap = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Bitmap&lt;/span&gt;( iBitMapWidth, iBitMapHeight );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;btmapLayer2 = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Bitmap&lt;/span&gt;( iBitMapWidth, iBitMapHeight );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;btmapLayer3 = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Bitmap&lt;/span&gt;( iBitMapWidth, iBitMapHeight );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;for&lt;/span&gt; ( &lt;span style="COLOR: blue"&gt;int&lt;/span&gt; i = 0; i &amp;lt; iBitMapWidth; i++ )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;for&lt;/span&gt; ( &lt;span style="COLOR: blue"&gt;int&lt;/span&gt; j = 0; j &amp;lt; iBitMapHeight; j++ )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 5"&gt;                              &lt;/span&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt; iRemain = 0;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 5"&gt;                              &lt;/span&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt; iColor = &lt;span style="COLOR: #2b91af"&gt;Math&lt;/span&gt;.DivRem( i, 255, &lt;span style="COLOR: blue"&gt;out&lt;/span&gt; iRemain );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 5"&gt;                              &lt;/span&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt; jRemain = 0;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 5"&gt;                              &lt;/span&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt; jColor = &lt;span style="COLOR: #2b91af"&gt;Math&lt;/span&gt;.DivRem( j, 255, &lt;span style="COLOR: blue"&gt;out&lt;/span&gt; jRemain );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 5"&gt;                              &lt;/span&gt;btmap.SetPixel( i, j, &lt;span style="COLOR: #2b91af"&gt;Color&lt;/span&gt;.FromArgb( iRemain, jRemain, jRemain ) );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; panelDrawing_Paint( &lt;span style="COLOR: blue"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: #2b91af"&gt;PaintEventArgs&lt;/span&gt; e )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Font&lt;/span&gt; stringFont =&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Font&lt;/span&gt;( &lt;span style="COLOR: #a31515"&gt;&amp;quot;Arial&amp;quot;&lt;/span&gt;, 10, &lt;span style="COLOR: #2b91af"&gt;FontStyle&lt;/span&gt;.Bold );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;panelDrawing.AutoScrollMinSize = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Size&lt;/span&gt;( iBitMapWidth, iBitMapHeight );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Graphics&lt;/span&gt; gr = &lt;span style="COLOR: #2b91af"&gt;Graphics&lt;/span&gt;.FromImage( btmap );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;gr.DrawEllipse( &lt;span style="COLOR: #2b91af"&gt;Pens&lt;/span&gt;.Blue, 10, 10, 20, 20 );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;gr.DrawString( &lt;span style="COLOR: #a31515"&gt;&amp;quot;From layer 1&amp;quot;&lt;/span&gt;, stringFont, &lt;span style="COLOR: #2b91af"&gt;Brushes&lt;/span&gt;.Red, 30, 10 );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Graphics&lt;/span&gt; grLayer2 = &lt;span style="COLOR: #2b91af"&gt;Graphics&lt;/span&gt;.FromImage( btmapLayer2 );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: green"&gt;//very important to clear the layer with transparent color&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;grLayer2.Clear( &lt;span style="COLOR: #2b91af"&gt;Color&lt;/span&gt;.Transparent);&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;grLayer2.FillEllipse( &lt;span style="COLOR: #2b91af"&gt;Brushes&lt;/span&gt;.Red, 40, 50, 20, 20 );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;grLayer2.DrawString( &lt;span style="COLOR: #a31515"&gt;&amp;quot;From layer 2&amp;quot;&lt;/span&gt;, stringFont, &lt;span style="COLOR: #2b91af"&gt;Brushes&lt;/span&gt;.Red, 60, 50 );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Graphics&lt;/span&gt; grLayer3 = &lt;span style="COLOR: #2b91af"&gt;Graphics&lt;/span&gt;.FromImage( btmapLayer3 );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;grLayer3.Clear( &lt;span style="COLOR: #2b91af"&gt;Color&lt;/span&gt;.Transparent );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;grLayer3.FillRectangle( &lt;span style="COLOR: #2b91af"&gt;Brushes&lt;/span&gt;.Yellow, 80, 80, 20, 20 );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;grLayer3.DrawString( &lt;span style="COLOR: #a31515"&gt;&amp;quot;From layer 3&amp;quot;&lt;/span&gt;, stringFont, &lt;span style="COLOR: #2b91af"&gt;Brushes&lt;/span&gt;.Yellow, 100, 80 );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;gr.DrawImage( btmapLayer2, 0, 0 );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;gr.DrawImage( btmapLayer3, 0, 0 );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: green"&gt;// Determine the drawing origin from the scroll bar positions&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt; x = panelDrawing.AutoScrollPosition.X;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;int&lt;/span&gt; y = panelDrawing.AutoScrollPosition.Y;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Rectangle&lt;/span&gt; clientRectangle = panelDrawing.ClientRectangle;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;clientRectangle.Offset( -x, -y );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Region&lt;/span&gt; visible = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Region&lt;/span&gt;( clientRectangle );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;e.Graphics.DrawImage( btmap, x, y );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;      &lt;/span&gt;}&lt;/span&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;/span&gt;&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-6352425552744051005?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/6352425552744051005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2009/06/layered-2d-drawing-using-gdi-and-c.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/6352425552744051005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/6352425552744051005'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2009/06/layered-2d-drawing-using-gdi-and-c.html' title='Layered 2D drawing using GDI+ and C#'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-6399990513018047143</id><published>2009-06-05T11:34:00.001-07:00</published><updated>2009-06-05T11:34:22.659-07:00</updated><title type='text'>Programmatically disable and enable tab page in C# winform  application</title><content type='html'>&lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font face="Calibri" size="3"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Tab control of .Net does not come with a handy enable and disable property for each tab page. The enabled property is available, but actually it is not working as it should be, like a text box control or other list view, etc. Therefore, you need to implement a few event handlers in order to make a tab page really support disable and enable.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font face="Calibri" size="3"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;The following sample gives detailed method to implement a function to disable and enable a tab control in a win form.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Steps to use following code:&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoListParagraphCxSpFirst" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font face="Calibri" size="3"&gt;1.&lt;/font&gt;&lt;span style="FONT: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Create a window form application using C#&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font face="Calibri" size="3"&gt;2.&lt;/font&gt;&lt;span style="FONT: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Drag a tab control to the form1&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font face="Calibri" size="3"&gt;3.&lt;/font&gt;&lt;span style="FONT: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Copy following code into form1.cs. &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN: 0cm 0cm 0pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font face="Calibri" size="3"&gt;4.&lt;/font&gt;&lt;span style="FONT: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Draw one button to each of the default tab page and link the click event of the button to a proper click event.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpLast" style="MARGIN: 0cm 0cm 10pt 36pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font face="Calibri" size="3"&gt;5.&lt;/font&gt;&lt;span style="FONT: 7pt &amp;#39;Times New Roman&amp;#39;"&gt;       &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Compile and run.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Now you will see that if you click the button on one tab page, the other tab page will be disabled and enabled like a text box control, grayed out and no selecting is allowable.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;You can use this method to control more than one tab control in one windows form. If you want to have tab control in more than one windows form to have similar behavior, you will need to implement a tab control first that include a tab control and implement this feature in the user control to avoid duplication.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font face="Calibri" size="3"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; System;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; System.Collections.Generic;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; System.ComponentModel;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; System.Data;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; System.Drawing;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; System.Text;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; System.Windows.Forms;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;namespace&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; TabEnable&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;{&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;      &lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;partial&lt;/span&gt; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Form1&lt;/span&gt; : &lt;span style="COLOR: #2b91af"&gt;Form&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;      &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; Form1()&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;InitializeComponent();&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: green"&gt;//programatically set the tab control property to allow disable and enable&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.tabControl1.DrawMode = &lt;span style="COLOR: #2b91af"&gt;TabDrawMode&lt;/span&gt;.OwnerDrawFixed;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.tabControl1.DrawItem += &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;DrawItemEventHandler&lt;/span&gt;( DisableTab_DrawItem );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.tabControl1.Selecting += &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;TabControlCancelEventHandler&lt;/span&gt;( DisableTab_Selecting );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; buttonEnablePage2_Click( &lt;span style="COLOR: blue"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: #2b91af"&gt;EventArgs&lt;/span&gt; e )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; ( tabControl1.TabPages[ 1 ].Enabled == &lt;span style="COLOR: blue"&gt;false&lt;/span&gt; )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.EnalbleTabPageByIndex( tabControl1, 1 );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.DisableTabPageByIndex( tabControl1, 1 );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.tabControl1.Invalidate();&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; buttonEnablePage1_Click( &lt;span style="COLOR: blue"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: #2b91af"&gt;EventArgs&lt;/span&gt; e )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; ( tabControl1.TabPages[ 0 ].Enabled == &lt;span style="COLOR: blue"&gt;false&lt;/span&gt; )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.EnalbleTabPageByIndex( tabControl1, 0 );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.DisableTabPageByIndex( tabControl1, 0 );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.tabControl1.Invalidate();&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: green"&gt;//if a tab page is selected, the selecting event will be canceled if it is disabled.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; DisableTab_Selecting( &lt;span style="COLOR: blue"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: #2b91af"&gt;TabControlCancelEventArgs&lt;/span&gt; e )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; ( !e.TabPage.Enabled )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;e.Cancel = &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: green"&gt;//draw a tab page based on whether it is disabled or enabled.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; DisableTab_DrawItem( &lt;span style="COLOR: blue"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: #2b91af"&gt;DrawItemEventArgs&lt;/span&gt; e )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;TabControl&lt;/span&gt; tabControl = sender &lt;span style="COLOR: blue"&gt;as&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;TabControl&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;TabPage&lt;/span&gt; page = tabControl.TabPages[ e.Index ];&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; ( !page.Enabled )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;using&lt;/span&gt; ( &lt;span style="COLOR: #2b91af"&gt;SolidBrush&lt;/span&gt; brush = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;SolidBrush&lt;/span&gt;( &lt;span style="COLOR: #2b91af"&gt;SystemColors&lt;/span&gt;.GrayText ) )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 5"&gt;                              &lt;/span&gt;e.Graphics.DrawString( page.Text, page.Font, brush, e.Bounds.X + 3, e.Bounds.Y + 3 );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;else&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;using&lt;/span&gt; ( &lt;span style="COLOR: #2b91af"&gt;SolidBrush&lt;/span&gt; brush = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;SolidBrush&lt;/span&gt;( page.ForeColor ) )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 5"&gt;                              &lt;/span&gt;e.Graphics.DrawString( page.Text, page.Font, brush, e.Bounds.X + 3, e.Bounds.Y + 3);&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: green"&gt;//disable a page of a tab control by index&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; DisableTabPageByIndex( &lt;span style="COLOR: #2b91af"&gt;TabControl&lt;/span&gt; tabControl, &lt;span style="COLOR: blue"&gt;int&lt;/span&gt; iPageIndex )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; ( iPageIndex &amp;gt;= tabControl.TabCount || iPageIndex &amp;lt; 0 )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;TabPage&lt;/span&gt; tabPage = tabControl.TabPages[ iPageIndex ];&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;tabPage.Enabled = &lt;span style="COLOR: blue"&gt;false&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: green"&gt;//enable a tab page by index&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; EnalbleTabPageByIndex( &lt;span style="COLOR: #2b91af"&gt;TabControl&lt;/span&gt; tabControl, &lt;span style="COLOR: blue"&gt;int&lt;/span&gt; iPageIndex )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt; ( iPageIndex &amp;gt;= tabControl.TabCount || iPageIndex &amp;lt; 0 )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;TabPage&lt;/span&gt; tabPage = tabControl.TabPages[ iPageIndex ];&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;tabPage.Enabled = &lt;span style="COLOR: blue"&gt;true&lt;/span&gt;;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;      &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;}&lt;/span&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font face="Calibri" size="3"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font face="Calibri" size="3"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font face="Calibri" size="3"&gt; &lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-6399990513018047143?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/6399990513018047143/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2009/06/programmatically-disable-and-enable-tab.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/6399990513018047143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/6399990513018047143'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2009/06/programmatically-disable-and-enable-tab.html' title='Programmatically disable and enable tab page in C# winform  application'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-2571525430473950036</id><published>2009-06-01T07:19:00.001-07:00</published><updated>2009-06-01T07:19:07.383-07:00</updated><title type='text'>Performance issue with WPF</title><content type='html'>&lt;div class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span style="FONT-SIZE: 13.5pt; COLOR: #333333; LINE-HEIGHT: 115%; FONT-FAMILY: &amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;"&gt;I found a few posts about the performance issue with WPF when large number of geometry objects will be rendered. Unfotunately this is the situation we are at. I will try it later and if this is the case, then I may stick with GDI+.&lt;/span&gt;&lt;/div&gt;  &lt;div class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span style="FONT-SIZE: 13.5pt; COLOR: #333333; LINE-HEIGHT: 115%; FONT-FAMILY: &amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;"&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span style="FONT-SIZE: 13.5pt; COLOR: #333333; LINE-HEIGHT: 115%; FONT-FAMILY: &amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;"&gt;&lt;a href="http://www.fernicola.org/loquitor/index.php?/archives/48-What-to-use-for-fast-2D-graphics.html"&gt;&lt;span style="BORDER-RIGHT: windowtext 1pt; PADDING-RIGHT: 0cm; BORDER-TOP: windowtext 1pt; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt; COLOR: black; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt; TEXT-DECORATION: none; text-underline: none; mso-border-alt: none windowtext 0cm"&gt;What to use for fast 2D graphics?&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;a href="http://www.fernicola.org/loquitor/index.php?/archives/48-What-to-use-for-fast-2D-graphics.html"&gt;&lt;font face="Calibri" color="#800080" size="3"&gt;http://www.fernicola.org/loquitor/index.php?/archives/48-What-to-use-for-fast-2D-graphics.html&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;font face="Calibri" size="3"&gt;A few people mentioned that WPF was not so good at big number of geometry handling. Performance is quite slow. &lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;font face="Calibri" size="3"&gt;In another blog, it is mentioned that&lt;/font&gt;&lt;/p&gt; &lt;p style="LINE-HEIGHT: 130%"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black; LINE-HEIGHT: 130%; FONT-FAMILY: &amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;"&gt;&lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;" However, if you were in the position to have to be constantly recreating the geometry of the objects that you are trying to render, then you might need the immediate mode API that GDI+ offers."&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;a href="http://stackoverflow.com/questions/275222/relative-merits-of-gdi-and-wpf"&gt;&lt;font face="Calibri" color="#800080" size="3"&gt;http://stackoverflow.com/questions/275222/relative-merits-of-gdi-and-wpf&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;font face="Calibri" size="3"&gt; &lt;/font&gt;&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-2571525430473950036?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/2571525430473950036/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2009/06/performance-issue-with-wpf.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/2571525430473950036'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/2571525430473950036'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2009/06/performance-issue-with-wpf.html' title='Performance issue with WPF'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-5247537526547192864</id><published>2009-06-01T07:03:00.001-07:00</published><updated>2009-06-01T07:03:44.440-07:00</updated><title type='text'>WPF Development</title><content type='html'>&lt;div class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;font face="Calibri" size="3"&gt;I am considering about converting my code from using GDI+ to WPF and try to find out a valid reason that I need do this now. &lt;/font&gt;&lt;/div&gt; &lt;div class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;font face="Calibri" size="3"&gt;&lt;/font&gt; &lt;/div&gt; &lt;div class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;font face="Calibri" size="3"&gt;The following are a few sources about WPF.&lt;/font&gt;&lt;/div&gt; &lt;div class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;font face="Calibri" size="3"&gt;Official WPF site&lt;/font&gt;&lt;/div&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;a href="http://msdn.microsoft.com/en-us/netframework/aa663321.aspx"&gt;&lt;font face="Calibri" color="#800080" size="3"&gt;http://msdn.microsoft.com/en-us/netframework/aa663321.aspx&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;font face="Calibri" size="3"&gt; &lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;font face="Calibri" size="3"&gt;A detailed comparison of GDI and WPF.&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;a href="http://www.leadtools.com/help/LEADTOOLS/v15/DH/Wpf/TO/Leadtools.Wpf.Topics~Leadtools.Wpf.Topics.DifferencesBetweenGDIANDWPF.html"&gt;&lt;font face="Calibri" color="#800080" size="3"&gt;http://www.leadtools.com/help/LEADTOOLS/v15/DH/Wpf/TO/Leadtools.Wpf.Topics~Leadtools.Wpf.Topics.DifferencesBetweenGDIANDWPF.html&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;font face="Calibri" size="3"&gt; &lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;font face="Calibri" size="3"&gt;This is a more formal discussion of WPF&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;a href="http://olafurandri.com/nyti/papers2006/Windows%20Presentation%20Foundation%20(WPF).pdf"&gt;&lt;font face="Calibri" color="#800080" size="3"&gt;http://olafurandri.com/nyti/papers2006/Windows%20Presentation%20Foundation%20(WPF).pdf&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;font face="Calibri" size="3"&gt; &lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;font face="Calibri" size="3"&gt;WPF is compatible with OpenGL. See this article.&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;a href="http://69.10.233.10/KB/WPF/WPFOpenGL.aspx"&gt;&lt;font face="Calibri" color="#800080" size="3"&gt;http://69.10.233.10/KB/WPF/WPFOpenGL.aspx&lt;/font&gt;&lt;/a&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;font face="Calibri" size="3"&gt; &lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;font face="Calibri" size="3"&gt; &lt;/font&gt;&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-5247537526547192864?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/5247537526547192864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2009/06/wpf-development.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/5247537526547192864'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/5247537526547192864'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2009/06/wpf-development.html' title='WPF Development'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-2777405134719091376</id><published>2009-05-29T09:01:00.001-07:00</published><updated>2009-05-29T09:01:52.312-07:00</updated><title type='text'>Code of the linear brush</title><content type='html'>This is the project code. &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-2777405134719091376?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/2777405134719091376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2009/05/code-of-linear-brush.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/2777405134719091376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/2777405134719091376'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2009/05/code-of-linear-brush.html' title='Code of the linear brush'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-4919023830319859244</id><published>2009-05-29T08:56:00.001-07:00</published><updated>2009-05-29T08:56:08.543-07:00</updated><title type='text'>How to create a linear brush using GDI+ and C#</title><content type='html'>&lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;This sample shows how to custom draw a customized button.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Just create a simple window form application and add a button to the form, then in the paint event of the button add a function like following. &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; System.Collections.Generic;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; System.ComponentModel;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; System.Data;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; System.Drawing;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; System.Text;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; System.Windows.Forms;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;using&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; System.Drawing.Drawing2D;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;namespace&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; LinearBrush&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;{&lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;      &lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;partial&lt;/span&gt; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;MainForm&lt;/span&gt; : &lt;span style="COLOR: #2b91af"&gt;Form&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;      &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; MainForm()&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;InitializeComponent();&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; button1_Paint( &lt;span style="COLOR: blue"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: #2b91af"&gt;PaintEventArgs&lt;/span&gt; e )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;using&lt;/span&gt; ( &lt;span style="COLOR: #2b91af"&gt;LinearGradientBrush&lt;/span&gt; brush =&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;      &lt;/span&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;LinearGradientBrush&lt;/span&gt;( e.ClipRectangle, &lt;span style="COLOR: #2b91af"&gt;Color&lt;/span&gt;.Orange,&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;&lt;span style="COLOR: #2b91af"&gt;Color&lt;/span&gt;.Maroon, &lt;span style="COLOR: #2b91af"&gt;LinearGradientMode&lt;/span&gt;.Horizontal ) )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;e.Graphics.FillEllipse( brush, e.ClipRectangle.X,e.ClipRectangle.Y,e.ClipRectangle.Width,e.ClipRectangle.Height/3 );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;System.Drawing.&lt;span style="COLOR: #2b91af"&gt;Font&lt;/span&gt; fnt = &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; &lt;span style="COLOR: #2b91af"&gt;Font&lt;/span&gt;( &lt;span style="COLOR: #a31515"&gt;&amp;quot;Microsoft Sans Serif&amp;quot;&lt;/span&gt;, 10 );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 4"&gt;                        &lt;/span&gt;e.Graphics.DrawString( &lt;span style="COLOR: #a31515"&gt;&amp;quot;Test&amp;quot;&lt;/span&gt; +&lt;span style="COLOR: #2b91af"&gt;DateTime&lt;/span&gt;.Now.ToString(), fnt, &lt;span style="COLOR: #2b91af"&gt;Brushes&lt;/span&gt;.Green, e.ClipRectangle );&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;&lt;span style="COLOR: blue"&gt;private&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; button1_Click( &lt;span style="COLOR: blue"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: #2b91af"&gt;EventArgs&lt;/span&gt; e )&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;{&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;&lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Text = &lt;span style="COLOR: #a31515"&gt;&amp;quot;Hello, &amp;quot;&lt;/span&gt; + &lt;span style="COLOR: #2b91af"&gt;DateTime&lt;/span&gt;.Now.ToString();&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 3"&gt;                  &lt;/span&gt;button1.Text = &lt;span style="COLOR: #a31515"&gt;&amp;quot;Clicked at &amp;quot;&lt;/span&gt; + &lt;span style="COLOR: #2b91af"&gt;DateTime&lt;/span&gt;.Now.ToString();&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 2"&gt;            &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;&lt;span style="mso-tab-count: 1"&gt;      &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="MARGIN: 0cm 0cm 10pt"&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: &amp;#39;Courier New&amp;#39;; mso-no-proof: yes"&gt;}&lt;/span&gt;&lt;span lang="EN-US" style="mso-ansi-language: EN-US"&gt;&lt;/span&gt;&lt;/p&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-4919023830319859244?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/4919023830319859244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2009/05/how-to-create-linear-brush-using-gdi.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/4919023830319859244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/4919023830319859244'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2009/05/how-to-create-linear-brush-using-gdi.html' title='How to create a linear brush using GDI+ and C#'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-6046931906387885351</id><published>2009-05-14T18:31:00.000-07:00</published><updated>2009-05-14T19:33:51.000-07:00</updated><title type='text'>How to create a chm file using HTLM Help Workshop</title><content type='html'>Start from here&lt;br /&gt;&lt;br /&gt;&lt;a href="http://frogleg.mvps.org/helptechnologies/htmlhelp/hhtutorials.html"&gt;http://frogleg.mvps.org/helptechnologies/htmlhelp/hhtutorials.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Double click a hhp file, the HTML help workshop will open automatically. With this tool you can create new project, create new html file and insert it into the project, add index, heading and so on.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-6046931906387885351?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/6046931906387885351/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2009/05/how-to-create-chm-file-using-htlm-help.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/6046931906387885351'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/6046931906387885351'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2009/05/how-to-create-chm-file-using-htlm-help.html' title='How to create a chm file using HTLM Help Workshop'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6168139672739372652.post-7706735609632225086</id><published>2009-05-04T06:00:00.000-07:00</published><updated>2009-05-04T06:02:49.007-07:00</updated><title type='text'>Software component market</title><content type='html'>A good start is here. It lists lots of available components to buy.&lt;br /&gt;&lt;a href="http://www.componentsource.com/features/index.html"&gt; Component Source&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6168139672739372652-7706735609632225086?l=comsell.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://comsell.blogspot.com/feeds/7706735609632225086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://comsell.blogspot.com/2009/05/software-component-market.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/7706735609632225086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6168139672739372652/posts/default/7706735609632225086'/><link rel='alternate' type='text/html' href='http://comsell.blogspot.com/2009/05/software-component-market.html' title='Software component market'/><author><name>David</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
