<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4023715279049293750</id><updated>2021-12-06T02:33:17.825-08:00</updated><category term="VISUAL BASIC 6.0"/><category term="TEKNIK AC"/><category term="Rangkaian Elektronik"/><category term="DIY"/><category term="Teknik"/><category term="Belajar Excel"/><category term="LISTRIK DAN ELEKTRONIK"/><category term="Matematika"/><category term="Tips dan Trik"/><category term="TIMBANGAN"/><category term="HP ANDROID"/><category term="SOFTWARE"/><title type='text'>MUKARAKAT</title><subtitle type='html'>APA SAJA DAN APA ADANYA</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default?start-index=26&amp;max-results=25'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>98</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-8413127531325158267</id><published>2017-09-18T13:31:00.000-07:00</published><updated>2018-01-13T09:44:44.503-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Belajar Excel"/><title type='text'>Cara Menghilangkan Gridlines Pada Excel </title><content type='html'>&lt;!--[if !mso]&gt;&lt;style&gt;v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} &lt;/style&gt;&lt;![endif]--&gt;&lt;br /&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt; &lt;w:WordDocument&gt;  &lt;w:View&gt;Normal&lt;/w:View&gt;  &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;  &lt;w:TrackMoves/&gt;  &lt;w:TrackFormatting/&gt;  &lt;w:PunctuationKerning/&gt;  &lt;w:ValidateAgainstSchemas/&gt;  &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;  &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;  &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;  &lt;w:DoNotPromoteQF/&gt;  &lt;w:LidThemeOther&gt;EN-US&lt;/w:LidThemeOther&gt;  &lt;w:LidThemeAsian&gt;X-NONE&lt;/w:LidThemeAsian&gt;  &lt;w:LidThemeComplexScript&gt;X-NONE&lt;/w:LidThemeComplexScript&gt;  &lt;w:Compatibility&gt;   &lt;w:BreakWrappedTables/&gt;   &lt;w:SnapToGridInCell/&gt;   &lt;w:WrapTextWithPunct/&gt;   &lt;w:UseAsianBreakRules/&gt;   &lt;w:DontGrowAutofit/&gt;   &lt;w:SplitPgBreakAndParaMark/&gt;   &lt;w:DontVertAlignCellWithSp/&gt;   &lt;w:DontBreakConstrainedForcedTables/&gt;   &lt;w:DontVertAlignInTxbx/&gt;   &lt;w:Word11KerningPairs/&gt;   &lt;w:CachedColBalance/&gt;  &lt;/w:Compatibility&gt;  &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;  &lt;m:mathPr&gt;   &lt;m:mathFont m:val=&quot;Cambria Math&quot;/&gt;   &lt;m:brkBin m:val=&quot;before&quot;/&gt;   &lt;m:brkBinSub m:val=&quot;--&quot;/&gt;   &lt;m:smallFrac m:val=&quot;off&quot;/&gt;   &lt;m:dispDef/&gt;   &lt;m:lMargin m:val=&quot;0&quot;/&gt;   &lt;m:rMargin m:val=&quot;0&quot;/&gt;   &lt;m:defJc m:val=&quot;centerGroup&quot;/&gt;   &lt;m:wrapIndent m:val=&quot;1440&quot;/&gt;   &lt;m:intLim m:val=&quot;subSup&quot;/&gt;   &lt;m:naryLim m:val=&quot;undOvr&quot;/&gt;  &lt;/m:mathPr&gt;&lt;/w:WordDocument&gt;&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt; &lt;w:LatentStyles DefLockedState=&quot;false&quot; DefUnhideWhenUsed=&quot;true&quot;   DefSemiHidden=&quot;true&quot; DefQFormat=&quot;false&quot; DefPriority=&quot;99&quot;   LatentStyleCount=&quot;267&quot;&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;0&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Normal&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;heading 1&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 2&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 3&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 4&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 5&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 6&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 7&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 8&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;9&quot; QFormat=&quot;true&quot; Name=&quot;heading 9&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 1&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 2&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 3&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 4&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 5&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 6&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 7&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 8&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; Name=&quot;toc 9&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;35&quot; QFormat=&quot;true&quot; Name=&quot;caption&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;10&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Title&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;1&quot; Name=&quot;Default Paragraph Font&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;11&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Subtitle&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;22&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Strong&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;20&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Emphasis&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;59&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Table Grid&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; UnhideWhenUsed=&quot;false&quot; Name=&quot;Placeholder Text&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;1&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;No Spacing&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 1&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 1&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 1&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 1&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 1&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 1&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; UnhideWhenUsed=&quot;false&quot; Name=&quot;Revision&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;34&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;List Paragraph&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;29&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Quote&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;30&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Intense Quote&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 1&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 1&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 1&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 1&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 1&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 1&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 1&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 1&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 2&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 2&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 2&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 2&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 2&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 2&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 2&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 2&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 2&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 2&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 2&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 2&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 2&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 2&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 3&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 3&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 3&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 3&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 3&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 3&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 3&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 3&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 3&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 3&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 3&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 3&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 3&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 3&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 4&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 4&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 4&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 4&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 4&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 4&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 4&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 4&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 4&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 4&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 4&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 4&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 4&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 4&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 5&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 5&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 5&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 5&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 5&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 5&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 5&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 5&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 5&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 5&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 5&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 5&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 5&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 5&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;60&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Shading Accent 6&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;61&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light List Accent 6&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;62&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Light Grid Accent 6&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;63&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 1 Accent 6&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;64&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Shading 2 Accent 6&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;65&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 1 Accent 6&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;66&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium List 2 Accent 6&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;67&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 1 Accent 6&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;68&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 2 Accent 6&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;69&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Medium Grid 3 Accent 6&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;70&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Dark List Accent 6&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;71&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Shading Accent 6&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;72&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful List Accent 6&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;73&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; Name=&quot;Colorful Grid Accent 6&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;19&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Subtle Emphasis&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;21&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Intense Emphasis&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;31&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Subtle Reference&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;32&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Intense Reference&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;33&quot; SemiHidden=&quot;false&quot;    UnhideWhenUsed=&quot;false&quot; QFormat=&quot;true&quot; Name=&quot;Book Title&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;37&quot; Name=&quot;Bibliography&quot;/&gt;  &lt;w:LsdException Locked=&quot;false&quot; Priority=&quot;39&quot; QFormat=&quot;true&quot; Name=&quot;TOC Heading&quot;/&gt; &lt;/w:LatentStyles&gt;&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 10]&gt;&lt;style&gt; /* Style Definitions */  table.MsoNormalTable  {mso-style-name:&quot;Table Normal&quot;;  mso-tstyle-rowband-size:0;  mso-tstyle-colband-size:0;  mso-style-noshow:yes;  mso-style-priority:99;  mso-style-qformat:yes;  mso-style-parent:&quot;&quot;;  mso-padding-alt:0in 5.4pt 0in 5.4pt;  mso-para-margin:0in;  mso-para-margin-bottom:.0001pt;  mso-pagination:widow-orphan;  font-size:11.0pt;  font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;  mso-ascii-font-family:Calibri;  mso-ascii-theme-font:minor-latin;  mso-fareast-font-family:&quot;Times New Roman&quot;;  mso-fareast-theme-font:minor-fareast;  mso-hansi-font-family:Calibri;  mso-hansi-theme-font:minor-latin;  mso-bidi-font-family:&quot;Times New Roman&quot;;  mso-bidi-theme-font:minor-bidi;} &lt;/style&gt;&lt;![endif]--&gt; &lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-align: center;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;times new roman&amp;quot; , &amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , &amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;span class=&quot;msoIns&quot;&gt;&lt;ins&gt;&lt;/ins&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://3.bp.blogspot.com/-USzFGY1a74A/WcAruPBMj3I/AAAAAAAACR8/66OrSh6QKoQ9NpxKAjm7Ar7rRGd6c-FIACLcBGAs/s1600/pb01.jpeg.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;235&quot; data-original-width=&quot;237&quot; src=&quot;https://3.bp.blogspot.com/-USzFGY1a74A/WcAruPBMj3I/AAAAAAAACR8/66OrSh6QKoQ9NpxKAjm7Ar7rRGd6c-FIACLcBGAs/s1600/pb01.jpeg.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , &amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;span class=&quot;msoIns&quot;&gt;&lt;ins&gt;Secara Default Jika kita membuka sebuah File &lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , &amp;quot;serif&amp;quot;;&quot;&gt;E&lt;/span&gt;xcel maka terdapat Gridlines atau &lt;/ins&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , &amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;span class=&quot;msoIns&quot;&gt;Garis-garis pada Excel. (Lihat gambar dibawah)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://4.bp.blogspot.com/-v6QFSgyF7SM/WcArue9od_I/AAAAAAAACR0/Xhzmn82vESY0L_bcPKovcAwmRTwHM_FiwCEwYBhgL/s1600/pb02.jpeg.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;300&quot; data-original-width=&quot;409&quot; height=&quot;234&quot; src=&quot;https://4.bp.blogspot.com/-v6QFSgyF7SM/WcArue9od_I/AAAAAAAACR0/Xhzmn82vESY0L_bcPKovcAwmRTwHM_FiwCEwYBhgL/s320/pb02.jpeg.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-align: center;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;times new roman&amp;quot; , &amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , &amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;span class=&quot;msoIns&quot;&gt;&lt;ins&gt;&lt;/ins&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , &amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;span class=&quot;msoIns&quot;&gt;&lt;ins&gt;Namun bagi anda yang ingin menghilangkan Gridlines atau Garis agar anda bisa melihatnya dengan bagus, ikuti langkah dibawah ini :&lt;/ins&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span id=&quot;goog_2117797276&quot;&gt;&lt;/span&gt;&lt;span id=&quot;goog_2117797277&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , &amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;span class=&quot;msoIns&quot;&gt;&lt;ins&gt;&lt;/ins&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , &amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;span class=&quot;msoIns&quot;&gt;&lt;ins&gt;&lt;/ins&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://4.bp.blogspot.com/--DMgK6JYiVs/WcArufh-IZI/AAAAAAAACRw/KImv84ZwsqwG2ekVittXCXLn2K8yAuyQwCEwYBhgL/s1600/pb03.jpeg.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;161&quot; data-original-width=&quot;398&quot; height=&quot;129&quot; src=&quot;https://4.bp.blogspot.com/--DMgK6JYiVs/WcArufh-IZI/AAAAAAAACRw/KImv84ZwsqwG2ekVittXCXLn2K8yAuyQwCEwYBhgL/s320/pb03.jpeg.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , &amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;span class=&quot;msoIns&quot;&gt;&lt;ins&gt;&lt;br /&gt;&lt;/ins&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;Klik View&lt;br /&gt;Kemudian Uncheck menu Gridlines&lt;br /&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , &amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;span class=&quot;msoIns&quot;&gt;&lt;ins&gt; maka hasilnya akan tampak seperti gambar dibawah ini :&lt;/ins&gt;&lt;/span&gt;&lt;/span&gt; &lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://1.bp.blogspot.com/-Qyb03pEuQQo/WcArvWeA49I/AAAAAAAACSA/Wklqhc9Y-zYPmT2jvI1harPN76kEkUM9ACEwYBhgL/s1600/pb04.jpeg.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;256&quot; data-original-width=&quot;403&quot; height=&quot;203&quot; src=&quot;https://1.bp.blogspot.com/-Qyb03pEuQQo/WcArvWeA49I/AAAAAAAACSA/Wklqhc9Y-zYPmT2jvI1harPN76kEkUM9ACEwYBhgL/s320/pb04.jpeg.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; text-align: center;&quot;&gt;&lt;span style=&quot;color: blue; font-family: &amp;quot;times new roman&amp;quot; , &amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , &amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;span class=&quot;msoIns&quot;&gt;&lt;ins&gt;&lt;/ins&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;times new roman&amp;quot; , &amp;quot;serif&amp;quot;; font-size: 12.0pt;&quot;&gt;&lt;span class=&quot;msoIns&quot;&gt;&lt;ins&gt;dan Garis atau Gridlines pun sudah hilang.&lt;/ins&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Cukup mudah bukan???&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/8413127531325158267'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/8413127531325158267'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/09/cara-menghilangkan-gridlines-pada-excel.html' title='Cara Menghilangkan Gridlines Pada Excel '/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://3.bp.blogspot.com/-USzFGY1a74A/WcAruPBMj3I/AAAAAAAACR8/66OrSh6QKoQ9NpxKAjm7Ar7rRGd6c-FIACLcBGAs/s72-c/pb01.jpeg.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-5879427283545350250</id><published>2017-03-14T12:40:00.005-07:00</published><updated>2017-03-14T12:40:36.407-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Printing Text</title><content type='html'>&lt;h1 class=&quot;title&quot;&gt;&lt;/h1&gt;&lt;div class=&quot;lw_vs&quot;&gt;    &lt;div id=&quot;curversion&quot;&gt;      &lt;strong&gt;                Visual Studio 6.0             &lt;/strong&gt;    &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;printingtext&quot;&gt;&lt;/a&gt;  Printing text in BASIC is done with the &lt;b&gt;Print &lt;/b&gt;statement. Similarly, in Visual Basic, you use the &lt;b&gt;Print&lt;/b&gt; method. This method works on the object you wish to print. This object can be an entire form, the &lt;b&gt;Debug&lt;/b&gt; object, the &lt;b&gt;Printer&lt;/b&gt; object, or a Picture control. We’ve already talked about how the &lt;b&gt;Debug.Print&lt;/b&gt; method directs output to the Immediate window (in Chapter 3). The other  methods display their output on their respective objects: &lt;br /&gt;&lt;ul type=&quot;disc&quot;&gt;&lt;li&gt; &lt;b&gt;Form1.Print&lt;/b&gt; sends output to &lt;b&gt;Form1’s&lt;/b&gt; background.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;b&gt;Picture1.Print&lt;/b&gt; sends the output to the &lt;b&gt;Picture1&lt;/b&gt; control.&lt;br /&gt;&lt;/li&gt;&lt;li&gt; &lt;b&gt;Printer.Print&lt;/b&gt; sends the output to the printer. &lt;/li&gt;&lt;/ul&gt;&lt;b&gt;WARNING: Recycled paper versus recycled electrons&lt;/b&gt;:  When testing your printing programs, remember that most of the methods  and properties you will use on the Printer object also can be used with  the Picture control. So for most of the examples in this chapter, I use  the Picture control to show you how the various methods and properties  work. Feel free to try any of these programs out using the &lt;b&gt;Printer&lt;/b&gt; object by substituting &lt;b&gt;Printer&lt;/b&gt; for &lt;b&gt;Picture1&lt;/b&gt;, sending your results directly to your printer. Only your recycler knows the difference.&lt;br /&gt; &lt;h2&gt;Printing to and beyond the Edges&lt;/h2&gt;The &lt;b&gt;Print &lt;/b&gt;method works much as you would expect. Each time you call the &lt;b&gt;Print&lt;/b&gt; method, the output will begin at the start of the next line, except if the previous &lt;b&gt;Print&lt;/b&gt; method ended with a comma or semicolon. In that case, the print would  be continued on the same line. Listing 9.4 contains an example of code  that allows printing beyond the right edge, and Figure 9.3 shows the  results.&lt;br /&gt; &lt;div class=&quot;blue&quot;&gt; &lt;b&gt;Listing 9.4: Command1_Click Event in Print&lt;/b&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;Private Sub Command1_Click()&lt;br /&gt;Dim i As Integer&lt;br /&gt;Picture1.Cls&lt;br /&gt;For i = 1 To 100&lt;br /&gt; &amp;nbsp; Picture1.Print “abcdefg”;&lt;br /&gt;Next i&lt;br /&gt;End Sub&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;blue&quot;&gt; &lt;/div&gt;&lt;img border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC97254.gif&quot; /&gt;&lt;br /&gt; &lt;div class=&quot;blue&quot;&gt; &lt;b&gt;Figure 9.3: &lt;/b&gt;Any printed output beyond the right edge of the control is lost.&lt;/div&gt;One limitation of this approach is that, eventually, you will reach the  end of the object. If you continue to print to the object, the text will  fall off the end of the paper or screen and not be visible. Likewise,  if you continue to print on the same line, it will also fall off the  edge and be lost. Neither of these conditions will generate an error or a  warning. Listing 9.5 contains an example of code that allows printing  beyond the bottom edge, and Figure 9.4 shows the results.&lt;br /&gt; &lt;div class=&quot;blue&quot;&gt; &lt;b&gt;Listing 9.5: Command2_Click Event in Print&lt;/b&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;Private Sub Command2_Click()&lt;br /&gt;Dim i As Integer&lt;br /&gt;Picture1.Cls&lt;br /&gt;For i = 1 To 100&lt;br /&gt; &amp;nbsp; Picture1.Print “abcdefg”&lt;br /&gt;Next i&lt;br /&gt;End Sub&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;blue&quot;&gt; &lt;/div&gt;&lt;img border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC34924.gif&quot; /&gt;&lt;br /&gt; &lt;div class=&quot;blue&quot;&gt; &lt;b&gt;Figure 9.4: &lt;/b&gt;Any printed output beyond the bottom edge of the page is lost&lt;/div&gt;&lt;b&gt;NOTE: Clearing the object&lt;/b&gt;: The &lt;b&gt;Cls&lt;/b&gt; method is used to clear the contents of a form or of a Picture control and to reposition the cursor to the beginning.&lt;br /&gt; &lt;h2&gt;Printing in Columns&lt;/h2&gt;Just like in the original BASIC, if you separate values by commas, each  value will start at the beginning of the next print zone. Print zones  are aligned based on absolute measurements, not characters. This makes  it easier to create columns, as long as your data is not wider than a  print zone. If it’s wider, you need to be careful to ensure that you are  starting the data in the proper print zone. The code shown in Listing  9.6 creates columns with commas. Figure 9.5 shows its output.&lt;br /&gt; &lt;div class=&quot;blue&quot;&gt; &lt;b&gt;Listing 9.6: Command3_Click Event in Print&lt;/b&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;Private Sub Command3_Click()&lt;br /&gt;Picture1.Cls&lt;br /&gt;Picture1.Print “abc”, “def”, “ghi”, “jkl”, “mno”, “pqr”, _&lt;br /&gt; &amp;nbsp; “stu”, “vwx”&lt;br /&gt;Picture1.Print “abcdef”, “ghijkl”, “mnopqr”, “stuvwx”&lt;br /&gt;Picture1.Print “abcdefghijkl”, “mnopqrstuvwx”&lt;br /&gt;Picture1.Print “abcdefghijklmnopqrstuvwxyz”, _&lt;br /&gt; &amp;nbsp; “abcdefghijklmnopqrstuvwxyz”&lt;br /&gt;End Sub&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;blue&quot;&gt; &lt;/div&gt;&lt;img border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC134106.gif&quot; /&gt;&lt;br /&gt; &lt;div class=&quot;blue&quot;&gt; &lt;b&gt;Figure 9.5: &lt;/b&gt;When you use commas, columns will line up as long as they are close to the same size. &lt;/div&gt;&lt;b&gt;TIP: Things go better with Tab&lt;/b&gt;: One of the functions available for the &lt;b&gt;Print&lt;/b&gt; method is the &lt;b&gt;Tab&lt;/b&gt; function. The &lt;b&gt;Tab&lt;/b&gt; function will position the output cursor at a particular column in the  output field. The width of a column is determined by the average width  of all of the characters in the current font. This is not the most  accurate way to align columns of information, but it is better than  relying on the effect of commas and semicolons.&lt;br /&gt; &lt;h2&gt;Positioning the Cursor&lt;/h2&gt;Another way to control printing alignment is by positioning the cursor. Each object (&lt;b&gt;Form&lt;/b&gt;, &lt;b&gt;Picture&lt;/b&gt;, and &lt;b&gt;Printer&lt;/b&gt;) maintains a cursor that describes the current position on the object. Two properties describe the location of the cursor: &lt;b&gt;CurrentX &lt;/b&gt;is the horizontal component, and &lt;b&gt;CurrentY&lt;/b&gt; is the vertical component. These properties can be read to find the  current location or assigned a value to reset the cursor to a new  position. As usual with these objects, all measurements are made in  twips. (Recall that one twip is exactly one-twentieth of a printer’s  point, and there are 1440 twips to the inch or 567 to the centimeter.)&lt;br /&gt;  The code in Listing 9.7 shows how to move around a PictureBox control using the &lt;b&gt;CurrentX&lt;/b&gt; and &lt;b&gt;CurrentY&lt;/b&gt; properties. I save the values of &lt;b&gt;CurrentX&lt;/b&gt; and &lt;b&gt;CurrentY&lt;/b&gt; into the string t before I execute the &lt;b&gt;Print&lt;/b&gt; method so that these values remain unaffected by the printing process. Figure 9.6 shows the output.&lt;br /&gt; &lt;div class=&quot;blue&quot;&gt; &lt;b&gt;Listing 9.7: Command4_Click Event in Print&lt;/b&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;Private Sub Command4_Click()&lt;br /&gt;Dim t As String&lt;br /&gt;Picture1.Cls&lt;br /&gt;t = FormatNumber(Picture1.CurrentX, 0) &amp;amp; “,” &amp;amp; _&lt;br /&gt; &amp;nbsp; FormatNumber(Picture1.CurrentY, 0)&lt;br /&gt;Picture1.Print t&lt;br /&gt;Picture1.CurrentX = 0&lt;br /&gt;Picture1.CurrentY = 2880&lt;br /&gt;t = FormatNumber(Picture1.CurrentX, 0) &amp;amp; “,” &amp;amp; _&lt;br /&gt; &amp;nbsp; FormatNumber(Picture1.CurrentY, 0)&lt;br /&gt;Picture1.Print t&lt;br /&gt;Picture1.CurrentX = 2880&lt;br /&gt;Picture1.CurrentY = 0&lt;br /&gt;t = FormatNumber(Picture1.CurrentX, 0) &amp;amp; “,” &amp;amp; _&lt;br /&gt; &amp;nbsp; FormatNumber(Picture1.CurrentY, 0)&lt;br /&gt;Picture1.Print t&lt;br /&gt;Picture1.CurrentX = 2880&lt;br /&gt;Picture1.CurrentY = 2880&lt;br /&gt;t = FormatNumber(Picture1.CurrentX, 0) &amp;amp; “,” &amp;amp; _&lt;br /&gt; &amp;nbsp; FormatNumber(Picture1.CurrentY, 0)&lt;br /&gt;Picture1.Print t&lt;br /&gt;End Sub&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;blue&quot;&gt; &lt;/div&gt;&lt;img border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC147119.gif&quot; /&gt;&lt;br /&gt; &lt;div class=&quot;blue&quot;&gt; &lt;b&gt;Figure 9.6: &lt;/b&gt;You can use the CurrentX and CurrentY properties to control the position of a PictureBox control. &lt;/div&gt;&lt;h2&gt;Positioning Text&lt;/h2&gt;So far, I haven’t talked about where the cursor is oriented with respect  to the text you’re going to print. Maybe it’s obvious, but the cursor  is always at the upper-left corner of an imaginary box that surrounds  the text. The actual size of the box is determined by the size of the  tallest character in the text string, the sum of the widths of each  individual character in the text string, and the font used to display  the text string.&lt;br /&gt;  Because this is a rather complicated process, Visual Basic includes two methods that return the size of the string: &lt;b&gt;TextWidth&lt;/b&gt; and &lt;b&gt;TextHeight&lt;/b&gt;.  Also, if you have embedded carriage returns, these methods will compute  the total size of the box based on the size of the longest line and the  total number of lines.&lt;br /&gt;  The code in Listing 9.8 shows how to display the same string of text in  four different quadrants surrounding the center point of the cursor.  Figure 9.7 shows the results.&lt;br /&gt;  &lt;b&gt;NOTE: Why is there a small space below the text string and behind the text string?&lt;/b&gt; This is because the &lt;b&gt;TextWidth &lt;/b&gt;method allows for space after the last character in the string, and the &lt;b&gt;TextHeight&lt;/b&gt; method includes space above and below the string. This way, you don’t need to worry about where to place the next string. &lt;br /&gt; &lt;div class=&quot;blue&quot;&gt; &lt;b&gt;Listing 9.8: Command5_Click Event in Print&lt;/b&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;Private Sub Command5_Click()&lt;br /&gt;Dim t As String&lt;br /&gt;t = “Hello”&lt;br /&gt;Picture1.Cls&lt;br /&gt;Picture1.CurrentX = 1440&lt;br /&gt;Picture1.CurrentY = 1440&lt;br /&gt;Picture1.Print t&lt;br /&gt;Picture1.CurrentX = 1440 - Picture1.TextWidth(t)&lt;br /&gt;Picture1.CurrentY = 1440&lt;br /&gt;Picture1.Print t&lt;br /&gt;Picture1.CurrentX = 1440&lt;br /&gt;Picture1.CurrentY = 1440 - Picture1.TextHeight(t)&lt;br /&gt;Picture1.Print t&lt;br /&gt;Picture1.CurrentX = 1440 - Picture1.TextWidth(t)&lt;br /&gt;Picture1.CurrentY = 1440 - Picture1.TextHeight(t)&lt;br /&gt;Picture1.Print t&lt;br /&gt;End Sub&lt;/code&gt;&lt;/pre&gt;&lt;div class=&quot;blue&quot;&gt; &lt;/div&gt;&lt;img border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC43566.gif&quot; /&gt;&lt;br /&gt; &lt;div class=&quot;blue&quot;&gt; &lt;b&gt;Figure 9.7: &lt;/b&gt;You can use the TextHeight and TextWidth methods to control the position of text. &lt;/div&gt;In&amp;nbsp;this example, I begin by printing the first string starting at 1 inch  from the top and 1 inch from the left margin (remember, 1440 twips  equal 1 inch). Next, I print the second string immediately to the right  of the first string. I compute its new X coordinate by subtracting the  width of the string.&lt;br /&gt;  The third string is printed above the second. Its X coordinate is  computed by subtracting the width of the string from the 1440-twips X  coordinate. Its Y coordinate is computed by subtracting the height of  the string from the 1440-twips Y coordinate. Finally, the last string is  printed above the first by subtracting the height of the string from  the 1-inch Y coordinate.&lt;br /&gt; &lt;h2&gt;Changing Font Characteristics&lt;/h2&gt;One of the nice features of Visual Basic is that it has the ability to  use multiple fonts in a single object. This means that you can make a  block of text bold, italic, or underlined. You can also change the size  or even the name of the font you wish to use. This allows you to present  information more dramatically by emphasizing certain items.&lt;br /&gt;  Doing this in Visual Basic is fairly easy. All you need to do is change  the Font object associated with the object you are using. In Listing  9.9, you can see that I copied the same code from the code shown in the  previous section and inserted some changes to Picture1’s Font property.&lt;br /&gt; &lt;div class=&quot;blue&quot;&gt; &lt;b&gt;Listing 9.9: Command6_Click Event in Print&lt;/b&gt;&lt;/div&gt;&lt;pre&gt;&lt;code&gt;Private Sub Command6_Click()&lt;br /&gt;Dim t As String&lt;br /&gt;t = “Hello”&lt;br /&gt;Picture1.Cls&lt;br /&gt;Picture1.CurrentX = 1440&lt;br /&gt;Picture1.CurrentY = 1440&lt;br /&gt;Picture1.Print t&lt;br /&gt;Picture1.Font.Bold = True&lt;br /&gt;Picture1.CurrentX = 1440 - Picture1.TextWidth(t)&lt;br /&gt;Picture1.CurrentY = 1440&lt;br /&gt;Picture1.Print t&lt;br /&gt;Picture1.Font.Italic = True&lt;br /&gt;Picture1.CurrentX = 1440&lt;br /&gt;Picture1.CurrentY = 1440 - Picture1.TextHeight(t)&lt;br /&gt;Picture1.Print t&lt;br /&gt;Picture1.Font.Size = 18&lt;br /&gt;Picture1.CurrentX = 1440 - Picture1.TextWidth(t)&lt;br /&gt;Picture1.CurrentY = 1440 - Picture1.TextHeight(t)&lt;br /&gt;Picture1.Print t&lt;br /&gt;Picture1.Font.Size = 8&lt;br /&gt;Picture1.Font.Bold = False&lt;br /&gt;Picture1.Font.Italic = False&lt;br /&gt;End Sub&lt;/code&gt;&lt;/pre&gt;As you can see in Figure 9.8, most of these changes did not materially  change how the information is aligned. However, in the upper-left  corner, where I changed the font size to 18, you can see that the text  is pulled slightly away from the other three text blocks. This is  because the padding areas above, below, and to the right of the text are  greater in an 18-point font than in the standard 8-point font.&lt;br /&gt; &lt;div class=&quot;blue&quot;&gt; &lt;/div&gt;&lt;img border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC54835.gif&quot; /&gt;&lt;br /&gt; &lt;div class=&quot;blue&quot;&gt; &lt;b&gt;Figure 9.8: &lt;/b&gt;You can change font characteristics to emphasize text. &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/5879427283545350250/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/printing-text.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/5879427283545350250'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/5879427283545350250'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/printing-text.html' title='Printing Text'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-4849342757599762284</id><published>2017-03-14T12:34:00.001-07:00</published><updated>2017-03-14T12:34:52.468-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Creating a 404 Error Tracker with Visual Basic 6.0</title><content type='html'>&lt;div class=&quot;lw_vs&quot;&gt;    &lt;div id=&quot;curversion&quot;&gt;      &lt;strong&gt;                Visual Studio 6.0             &lt;/strong&gt;    &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;404track&quot;&gt;       &lt;/a&gt;  &amp;nbsp; &lt;br /&gt;&lt;b&gt;Contents&lt;br /&gt; &lt;/b&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa227334.aspx#404track_topic1&quot;&gt;Introduction&lt;/a&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa227334.aspx#404track_topic2&quot;&gt;Prerequisites&lt;/a&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa227334.aspx#404track_topic3&quot;&gt;Quick Overview&lt;/a&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa227334.aspx#404track_topic4&quot;&gt;Preparing IIS&lt;/a&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa227334.aspx#404track_topic5&quot;&gt;Preparing SQL Server&lt;/a&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa227334.aspx#404track_topic6&quot;&gt;Starting the DLL&lt;/a&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa227334.aspx#404track_topic7&quot;&gt;Into the Code&lt;/a&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa227334.aspx#404track_topic8&quot;&gt;Conclusion&lt;/a&gt;&lt;code&gt;&lt;br /&gt;&lt;/code&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa227334.aspx#404track_topic9&quot;&gt;Additional Information&lt;/a&gt;&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;404track_topic1&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;In  this article, I will walk you through the steps of building a Visual  Basic® 6.0 ActiveX® dynamic-link library (DLL) that will make it easy  and efficient for you to track and prevent 404 (Not Found) errors on  your site. Sure, some stats packages will do parts of this work for you,  but most are not flexible in their &quot;out-of-the-box&quot; feature set. Now  you will have a chance to expand the techniques in this article to have  your 404 tracking and trapping do just about anything you want it to do.  Or, you could use the same techniques to build your own ActiveX DLL  that has nothing to do with 404 errors.&lt;br /&gt; You might have already  asked yourself why I chose a DLL instead of simple Active Server Pages  (ASP) code, or even an Include file. A compelling argument against using  a DLL is the debugging process. Because Internet Information Server  (IIS) holds DLLs in memory, and unless your application is set to run in  a separate memory space from the other applications in your Web server,  IIS must be restarted when you make changes to any DLL attached to the  server. This slows the debugging process somewhat, particularly in the  fine-tuning stages.&lt;br /&gt; With those problems aside, I chose a DLL  mainly for performance reasons. Compiled code is known to be more  efficient than interpreted code, particularly with advanced tasks such  as the one this DLL proposes. Also, aside from the obvious performance  gains, by storing your business logic in a compiled format:  &lt;br /&gt;&lt;ul type=&quot;disc&quot;&gt;&lt;li&gt;Your code cannot be easily &quot;borrowed.&quot;&lt;/li&gt;&lt;li&gt;Your application cannot be easily compromised by someone who decides to modify your code.&lt;/li&gt;&lt;li&gt;Microsoft SQL Server passwords and other sensitive data are better shielded from prying eyes.&lt;/li&gt;&lt;/ul&gt;While  these benefits are always important, they become even more so when your  code is going to be distributed, placed on a shared server, or placed  on a server completely outside of your control. In my case, I place the  integrity of the code at a much higher priority than whether or not it  will be stolen.&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;404track_topic2&quot;&gt;&lt;/a&gt;Prerequisites&lt;/h2&gt;Before we start, let&#39;s make sure you&#39;ve got the goods. You will need the following items installed and running:  &lt;br /&gt;&lt;ul type=&quot;disc&quot;&gt;&lt;li&gt;Microsoft® Windows NT® 4.0 (Workstation or Server), Service Pack 4 or later.&lt;/li&gt;&lt;li&gt;Windows NT 4.0 Option Pack (IIS/PWS 4.0).&lt;/li&gt;&lt;li&gt;The latest Microsoft Data Access Components (MDAC) release (2.1 Service Pack 2 at the time of writing).&lt;/li&gt;&lt;li&gt;Visual Basic 6.0, Service Pack 2 or later.&lt;/li&gt;&lt;li&gt;SQL Server 6.5 or later (you could use Microsoft Access, but in this article, SQL Server 7.0 and a stored procedure are used).&lt;/li&gt;&lt;/ul&gt;&lt;blockquote class=&quot;dtBlock&quot;&gt; &lt;b&gt;Note&lt;/b&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;If  you are running Windows 2000, there are no service packs, you cannot  update core MDAC files, and you will have to add IIS (if it isn&#39;t  already installed).&lt;/blockquote&gt;To add IIS:  &lt;br /&gt;&lt;ol type=&quot;1&quot;&gt;&lt;li&gt;In Control Panel, click the Add/Remove Programs icon.&lt;/li&gt;&lt;li&gt;Select &lt;b&gt;Windows Components&lt;/b&gt;, then click the &lt;b&gt;Add/Remove&lt;/b&gt; button. This will open the &lt;b&gt;Windows Components Wizard&lt;/b&gt; dialog box. (Do not attempt to install the Option Pack or MDAC updates on Windows 2000.)&lt;/li&gt;&lt;li&gt;Select the &lt;b&gt;Internet Information Services&lt;/b&gt; check box.&lt;/li&gt;&lt;li&gt;Adjust &lt;b&gt;Details&lt;/b&gt; as necessary.&lt;/li&gt;&lt;/ol&gt;Additionally, you will need to run this on a computer where you have appropriate permissions to do the following things:  &lt;br /&gt;&lt;ul&gt;&lt;li&gt;Create a custom 404 page for your Web site(s).&lt;/li&gt;&lt;li&gt;Register a custom DLL on your server.&lt;/li&gt;&lt;li&gt;Restart the Web server (during development). I recommend using a workstation or noncritical Web server for development.&lt;/li&gt;&lt;/ul&gt;&lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;404track_topic3&quot;&gt;&lt;/a&gt;Quick Overview&lt;/h2&gt;Here are the steps involved in creating this system:  &lt;br /&gt;&lt;ol type=&quot;1&quot;&gt;&lt;li&gt;Install prerequisites and verify task permissions.&lt;/li&gt;&lt;li&gt;Enable the custom 404 error page through Internet Services Manager.&lt;/li&gt;&lt;li&gt;Create and test the database and schema.&lt;/li&gt;&lt;li&gt;Create a new ActiveX DLL project and add appropriate references.&lt;/li&gt;&lt;li&gt;Write the code and compile the DLL.&lt;/li&gt;&lt;li&gt;Register the DLL on the development computer.&lt;/li&gt;&lt;li&gt;Edit the 404 error ASP page to instantiate the object.&lt;/li&gt;&lt;li&gt;Before deploying to the production computer, test, test, test!&lt;/li&gt;&lt;/ol&gt;&lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;404track_topic4&quot;&gt;&lt;/a&gt;Preparing IIS&lt;/h2&gt;Create  a file called 404.asp and place it in your root folder (or the folder  of the application). This will serve as a replacement for the bland &quot;404  Not Found&quot; error page, and will be the calling point of the component  we&#39;re creating. Feel free to customize it with graphics, a friendly  &quot;sorry&quot; message, and of course, links to the rest of your site.&lt;br /&gt; &lt;blockquote class=&quot;dtBlock&quot;&gt; &lt;b&gt;Note&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/b&gt;If  you use graphics or links on this page, remember to use absolute  references or virtual reference &quot;FROM THE ROOT.&quot; This file will &quot;run&quot;  where it&#39;s called, so if you use &lt;code&gt;&amp;lt;img src=&quot;images/logo.gif&quot;&amp;gt;&lt;/code&gt; where logo.gif is in /images/logo.gif, then a 404 hit in the /test/  folder will result in one of those lovely broken images (since 404.asp  is &quot;running&quot; in /test/ it is looking for /test/images/logo.gif instead  of /images/logo.gif).&lt;/blockquote&gt;&lt;ol type=&quot;1&quot;&gt;&lt;li&gt;Open Internet Services Manager.&lt;/li&gt;&lt;/ol&gt;If you want the file to apply to your entire site:  &lt;br /&gt;&lt;ul type=&quot;disc&quot;&gt;&lt;li&gt;Right-click the machine name in IIS.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Properties&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Select &lt;b&gt;Master Properties&lt;/b&gt; for the WWW Service, then click &lt;b&gt;Edit&lt;/b&gt;.&lt;/li&gt;&lt;/ul&gt;If you want the file to apply to a specific application:  &lt;br /&gt;&lt;ul type=&quot;disc&quot;&gt;&lt;li&gt;Right-click the name of the application in IIS.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Properties&lt;/b&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;ol type=&quot;1&quot;&gt;&lt;li&gt;Click the &lt;b&gt;Custom Errors&lt;/b&gt; tab.&lt;/li&gt;&lt;li&gt;Scroll down and select 404.&lt;/li&gt;&lt;li&gt;Click the &lt;b&gt;Edit properties&lt;/b&gt; button and change the &lt;b&gt;Message Type&lt;/b&gt; to URL.&lt;/li&gt;&lt;li&gt;Enter /404.asp or /&amp;lt;application&amp;gt;/404.asp as the URL.&lt;/li&gt;&lt;/ol&gt;&lt;div class=&quot;fig&quot;&gt;&lt;code&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC3204.gif&quot; /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 1. Custom 404 error dialog&lt;/b&gt;&lt;/div&gt;The  beauty of this solution is that when you use an ASP page to process 404  errors, the query string includes the page that was being requested  (and the headers often provide information for the page that contained  the bad link). You can do many things with this information. On the  front end, the most important thing would be to conditionally offer  appropriate alternatives based on the requested page (the ultimate goal  is to build a learning application that adapts this for you). On the  back end for each request, you would need to notify the site with the  bad link; maintain a database of frequently requested 404 pages (and  their preferred alternate pages, if any); and replace those nonexistent  pages with a redirect page (optional). In this article, we will simply  be logging the 404 entries (future articles will cover these other  areas).&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;404track_topic5&quot;&gt;&lt;/a&gt;Preparing SQL Server&lt;/h2&gt;The  last thing you have to do before creating the DLL is set up a database  to store the data. (I chose to use SQL Server because of its flexibility  and scalability, though you can certainly use any ODBC-compliant  database—as long as you are aware of possible limitations.) The database  in this article is called &quot;track404&quot; and the table is called &quot;stats.&quot;  Stats will initially consist of six fields:  &lt;br /&gt;&lt;ul type=&quot;disc&quot;&gt;&lt;li&gt;&lt;b&gt;id&lt;/b&gt; (INT IDENTITY), which represents an index field.&lt;/li&gt;&lt;li&gt;&lt;b&gt;ip&lt;/b&gt; (VARCHAR 15), which represents the user&#39;s IP address.&lt;/li&gt;&lt;li&gt;&lt;b&gt;url&lt;/b&gt; (VARCHAR 255), which represents the URL they were trying to access.&lt;/li&gt;&lt;li&gt;&lt;b&gt;ref&lt;/b&gt; (VARCHAR 255), which represents the URL they came from (e.g., a bad link).&lt;/li&gt;&lt;li&gt;&lt;b&gt;dt&lt;/b&gt; (DATETIME), which represents the exact time they entered the site.&lt;/li&gt;&lt;li&gt;&lt;b&gt;ua&lt;/b&gt; (VARCHAR 255), which represents the browser they were using.&lt;/li&gt;&lt;/ul&gt;Here is a screen shot of the table from within Enterprise Manager:&lt;br /&gt; &lt;div class=&quot;fig&quot;&gt;&lt;code&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC118985.gif&quot; /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 2. New table in Enterprise Manager&lt;/b&gt;&lt;/div&gt;Next you need to add a user to this database. To do this:  &lt;br /&gt;&lt;ol type=&quot;1&quot;&gt;&lt;li&gt;Under &lt;b&gt;Security&lt;/b&gt; for this SQL Server Registration, select &lt;b&gt;Logins&lt;/b&gt; and add a Login named &quot;stats&quot; (with any password you choose).&lt;/li&gt;&lt;li&gt;Give the user permission on your new database.&lt;/li&gt;&lt;li&gt;Once that user is added, right-click your new table and click &lt;b&gt;Properties&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Click the &lt;b&gt;Permissions&lt;/b&gt; button in the top right corner, and give the user &quot;stats&quot; INSERT permissions.&lt;/li&gt;&lt;/ol&gt;Instead  of relying on simple insert techniques, you can compile the typical  insertion code into a stored procedure. It is a simple stored procedure  that accepts five string parameters as inputs and inserts them into a  table. This will be faster than a general insert, and while the  difference is negligible now, the added efficiency of stored procedures  will be significant as your tracking system gets more elaborate. Here is  the code from the stored procedure:&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-1&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_24fbd865-b565-4640-a611-cf63c8de706d&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;CREATE PROCEDURE STrack404&lt;br /&gt;   @ip varchar(15),&lt;br /&gt;   @url varchar(255),&lt;br /&gt;   @ref varchar(255),&lt;br /&gt;   @dt char(20),&lt;br /&gt;   @ua varchar(255)&lt;br /&gt;&lt;br /&gt;  AS&lt;br /&gt;&lt;br /&gt;   BEGIN&lt;br /&gt;    INSERT INTO stats (ip,url,ref,dt,ua)&lt;br /&gt;      VALUES (@ip,@url,@ref,@dt,@ua)&lt;br /&gt;   END&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;To give executive permissions to the stats user:  &lt;br /&gt;&lt;ol type=&quot;1&quot;&gt;&lt;li&gt;Under &lt;b&gt;Stored Procedures&lt;/b&gt; in this database, right-click and select &quot;&lt;b&gt;New Stored Procedure&lt;/b&gt;&quot;&lt;/li&gt;&lt;li&gt;Name it STrack404, and insert the above code. Click OK.&lt;/li&gt;&lt;li&gt;Right-click, then select &lt;b&gt;Properties&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Apply exec permissions for the &quot;stats&quot; user.&lt;/li&gt;&lt;/ol&gt;Finally,  we need to create a connection string, which will be used in the  component later. If you&#39;re not using integrated security, you must add  the user ID (UID) and password (PWD) into the connection string, as  shown in the following code example:&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-2&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_2d686bbf-2615-4c5a-b495-e6073a15ef5a&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;&quot;driver={SQL Server};server=1.1.1.1;database=track404;uid=stats;pwd=xyz&quot;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Test your connection string in a simple ASP page before proceeding,  and make any necessary corrections before moving on. There&#39;s no greater  frustration than having to recompile a DLL simply to straighten out a  botched database connection string. Here is an example of what your test  ASP page could look like:&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-3&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_ef08a33e-fb46-4437-aabc-739c8aea7d87&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;&amp;lt;%&lt;br /&gt;  set conn = createobject(&quot;adodb.connection&quot;)&lt;br /&gt;  on error resume next&lt;br /&gt;  conn.open &quot;driver={SQL Server};server=1.1.1.1;database=track404;uid=stats;pwd=xyz&quot;&lt;br /&gt;  if err then&lt;br /&gt;   response.write(&quot;There was an error:&amp;lt;br&amp;gt;&quot; &amp;amp; err.description)&lt;br /&gt;  else&lt;br /&gt;   response.write(&quot;No problem.&quot;)&lt;br /&gt;  end if&lt;br /&gt;  set conn = nothing   &lt;br /&gt;%&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;404track_topic6&quot;&gt;&lt;/a&gt;Starting the DLL&lt;/h2&gt;Open  Visual Basic and start a new ActiveX DLL project. The first thing you  want to do when creating a project is right-click the Project Name and  change it, as well as change the initial class name to something you&#39;ll  remember. Naming a project &quot;Project5&quot; does very little to set it apart  from &quot;Project3&quot; or &quot;Project4.&quot; In this case, they are named &quot;Bertrand&quot;  and &quot;track404,&quot; respectively. (Incidentally, unless other project  changes are made, this will cause the ProgID of the compiled DLL to be  &quot;Bertrand.track404,&quot; and that is what is used in the &lt;b&gt;createObject()&lt;/b&gt; call from ASP. Also, the compiled DLL will be called &quot;Bertrand.dll.&quot;  You are more than welcome to use any name for your project and DLL. Just  make sure it&#39;s unique so that you won&#39;t be crosswiring anything in the  registry.&lt;br /&gt; Next, select &lt;b&gt;Project&lt;/b&gt;, then &lt;b&gt;References&lt;/b&gt;, and add the following references:  &lt;br /&gt;&lt;ul type=&quot;disc&quot;&gt;&lt;li&gt;Microsoft Active Server Pages Object Library.&lt;/li&gt;&lt;li&gt;Microsoft ActiveX Data Objects 2.1 Library.&lt;/li&gt;&lt;li&gt;Microsoft Transaction Server Type Library.&lt;/li&gt;&lt;/ul&gt;These references allow you to use the intrinsic ASP objects (&lt;b&gt;Application&lt;/b&gt;, &lt;b&gt;Request&lt;/b&gt;, &lt;b&gt;Response&lt;/b&gt;, &lt;b&gt;Server&lt;/b&gt;, and &lt;b&gt;Session&lt;/b&gt;) and ADO objects (such as &lt;b&gt;ADODB.Connection&lt;/b&gt;).&lt;br /&gt; &lt;blockquote class=&quot;dtBlock&quot;&gt; &lt;b&gt;Note&lt;/b&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;In  Windows 2000, as you can see in the following screenshot, the Microsoft  Transaction Server Type Library reference has been replaced by &quot;COM+  Services Type Library.&quot;&lt;/blockquote&gt;&lt;div class=&quot;fig&quot;&gt;&lt;code&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC142717.gif&quot; /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 3. Adding references to your project&lt;/b&gt;&lt;/div&gt;&lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;404track_topic7&quot;&gt;&lt;/a&gt;Into the Code&lt;/h2&gt;The first item we&#39;re going to need is the &lt;b&gt;Request&lt;/b&gt; object. In this initial build, we have no need for &lt;b&gt;Session&lt;/b&gt; and &lt;b&gt;Application&lt;/b&gt; variables, nor for the &lt;b&gt;Response&lt;/b&gt; and &lt;b&gt;Server&lt;/b&gt; objects, so there&#39;s no point in introducing them into your code. The &lt;b&gt;Request&lt;/b&gt; object will allow us to retrieve the user-specific information we&#39;ll want to track. We&#39;ll also set up our &lt;b&gt;Connection&lt;/b&gt; object and &lt;b&gt;Logic&lt;/b&gt; variables, as shown below.&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-4&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_17c62e6f-79d3-4615-aaf4-fe48debe0a29&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Option Explicit&lt;br /&gt;&lt;br /&gt;  &#39; Create the connection object:&lt;br /&gt;  Public objConnection As ADODB.Connection&lt;br /&gt;&lt;br /&gt;  &#39; Create the servervariable, SQL and datetime strings:&lt;br /&gt;  Public strReferrer As String&lt;br /&gt;  Public strQueryString As String&lt;br /&gt;  Public strServerName As String&lt;br /&gt;  Public strIPAddress As String&lt;br /&gt;  Public strBrowser As String&lt;br /&gt;  Public strSQL As String&lt;br /&gt;  Public strNow As String&lt;br /&gt;&lt;br /&gt;  &#39; Create the array to strip the server name out of the URL:&lt;br /&gt;  Public vntServerName As Variant&lt;br /&gt;&lt;br /&gt;  &#39; Create the boolean which will indicate whether to log or not:&lt;br /&gt;  Public boolValid As Boolean&lt;br /&gt;&lt;br /&gt;  &#39; Create the objects for getting at the ASP Request object&lt;br /&gt;  Public objContext As ObjectContext&lt;br /&gt;  Public objRequest As ASPTypeLibrary.Request&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Below is a very simple function that grabs any &lt;b&gt;Server&lt;/b&gt;  variable and removes the always troublesome apostrophe, instead of  performing this code each time it is required. I called this function &lt;b&gt;getSV&lt;/b&gt;, and it is as follows:&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-5&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_0c707293-25e4-4675-aa7d-b24973a9d95c&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;  Public Function getSV(ByVal str As String) As String&lt;br /&gt;     getSV = Replace(objRequest.ServerVariables(str), &quot;&#39;&quot;, &quot;&#39;&#39;&quot;)&lt;br /&gt;  End Function&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The above code retrieves information such as the user&#39;s IP address  and the URL they were referred from (if that information is available).  Now, create a method called &lt;b&gt;Log()&lt;/b&gt;—; this is where all the action takes place. Once the &lt;b&gt;Request&lt;/b&gt; object is created, we call &lt;b&gt;getSV()&lt;/b&gt; to get the user-specific variables. We set &lt;code&gt;boolValid = false&lt;/code&gt; so that the default is to NOT log this hit into the database unless the  404 page was accessed legitimately. For example, if someone just types  in the URL of your 404 page, the hit shouldn&#39;t be logged.&lt;br /&gt; Next  you need to test that the length of the query string is at least four  and that the first four characters are &quot;404;&quot;. If both conditions are  true, you then set the boolValid flag to true, and parse the URL for  everything after the server name (that&#39;s the reason for &lt;b&gt;vntServerName&lt;/b&gt;).  For example, if the user attempts to get to the URL  http://yourserver/page.asp, then the only relevant information is  /page.asp—no sense filling up the database with  http://yourserver/prefixes (unless, of course, you&#39;re using a common 404  page for several distinct domain names in a multiple host header  situation, in which case you can simply remove the last if/end if  block). As mentioned earlier, there are safeguards in place that do not  log the entry if there is no query string. Additionally, we don&#39;t log  the entry if the file requested was Favicon.ico (which happens when a  user adds your site to their favorites in Internet Explorer 4.0 or 5.0).  This will be addressed more in future articles.&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-6&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_30cb02b1-047a-4ecf-a642-71a8909a638d&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;  Public Function log() As Long&lt;br /&gt;&lt;br /&gt;    &#39; get the Request object, and parse out the ServerVariables items:&lt;br /&gt;    Set objContext = GetObjectContext()&lt;br /&gt;    Set objRequest = objContext(&quot;Request&quot;)&lt;br /&gt;    strQueryString = LCase(getSV(&quot;query_string&quot;))&lt;br /&gt;    strServerName = LCase(getSV(&quot;server_name&quot;))&lt;br /&gt;    strReferrer = LCase(getSV(&quot;http_referer&quot;))&lt;br /&gt;    strIPAddress = getSV(&quot;remote_addr&quot;)&lt;br /&gt;    strBrowser = getSV(&quot;http_user_agent&quot;)&lt;br /&gt;    strNow = FormatDateTime(Now(), vbShortDate) &amp;amp; &quot; &quot;&lt;br /&gt;    strNow = strNow &amp;amp; FormatDateTime(Now(), vbShortTime)&lt;br /&gt;&lt;br /&gt;    &#39; initialize boolValid as false until it passes&lt;br /&gt;    boolValid = False&lt;br /&gt;&lt;br /&gt;    &#39; make sure the querystring is at least 4 characters, otherwise&lt;br /&gt;    &#39; they entered the URL directly and should not be logged&lt;br /&gt;    If Len(strQueryString) &amp;gt; 4 Then&lt;br /&gt;&lt;br /&gt;      &#39; Do not log if the beginning of the querystring is not 404&lt;br /&gt;      If Left(strQueryString, 4) = &quot;404;&quot; then&lt;br /&gt;&lt;br /&gt;        &#39; Do not log if it&#39;s a search for favicon.ico, which is what&lt;br /&gt;        &#39;  happens when someone adds your site to their favorites:&lt;br /&gt;        If InStr(strQueryString, &quot;favicon.ico&quot;) &amp;lt;= 0 Then&lt;br /&gt;          strQueryString = Right(strQueryString, Len(strQueryString) - 4)&lt;br /&gt;          boolValid = True&lt;br /&gt;&lt;br /&gt;          &#39; Remove the server name from the URL in the QueryString&lt;br /&gt;          If InStr(strQueryString, strServerName) &amp;gt; 0 Then&lt;br /&gt;            vntServerName = Split(strQueryString, strServerName)&lt;br /&gt;            strQueryString = vntServerName(1)&lt;br /&gt;          End If&lt;br /&gt;        End If&lt;br /&gt;      End If&lt;br /&gt;    End If&lt;br /&gt;&lt;br /&gt;    &#39; Clean up ObjectContext&lt;br /&gt;    Set objRequest = Nothing&lt;br /&gt;    Set objContext = Nothing&lt;br /&gt;&lt;br /&gt;    &#39; Log the 404 hit, if valid:&lt;br /&gt;    If boolValid Then&lt;br /&gt;      strSQL = &quot;exec STrack404&quot;&lt;br /&gt;      strSQL = strSQL &amp;amp; &quot;  @ip  =&#39;&quot; &amp;amp; strIPAddress &amp;amp; &quot;&#39;&quot;&lt;br /&gt;      strSQL = strSQL &amp;amp; &quot;, @url =&#39;&quot; &amp;amp; strQueryString &amp;amp; &quot;&#39;&quot;&lt;br /&gt;      strSQL = strSQL &amp;amp; &quot;, @ref =&#39;&quot; &amp;amp; strReferrer &amp;amp; &quot;&#39;&quot;&lt;br /&gt;      strSQL = strSQL &amp;amp; &quot;, @dt  =&#39;&quot; &amp;amp; strNow &amp;amp; &quot;&#39;&quot;&lt;br /&gt;      strSQL = strSQL &amp;amp; &quot;, @ua  =&#39;&quot; &amp;amp; strBrowser &amp;amp; &quot;&#39;&quot;&lt;br /&gt;      Set objConnection = CreateObject(&quot;adodb.connection&quot;)&lt;br /&gt;      objConnection.open &quot;driver={SQL Server};server=1.1.1.1;database=track404;uid=stats;pwd=xyz&quot;&lt;br /&gt;      objConnection.Execute (strSQL)&lt;br /&gt;      objConnection.Close&lt;br /&gt;      Set objConnection = Nothing&lt;br /&gt;    End If&lt;br /&gt;  End Function&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;So in summary, here&#39;s the entire listing of track404.cls (comments removed):&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-7&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_5ab53a83-7742-468c-80a1-fa7bd1072b31&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;  Option Explicit&lt;br /&gt;&lt;br /&gt;  Public objConnection As ADODB.Connection&lt;br /&gt;&lt;br /&gt;  Public strReferrer As String&lt;br /&gt;  Public strQueryString As String&lt;br /&gt;  Public strServerName As String&lt;br /&gt;  Public strIPAddress As String&lt;br /&gt;  Public strBrowser As String&lt;br /&gt;  Public strSQL As String&lt;br /&gt;  Public strNow As String&lt;br /&gt;&lt;br /&gt;  Public vntServerName As Variant&lt;br /&gt;&lt;br /&gt;  Public boolValid As Boolean&lt;br /&gt;&lt;br /&gt;  Public objContext As ObjectContext&lt;br /&gt;  Public objRequest As ASPTypeLibrary.Request&lt;br /&gt;&lt;br /&gt;  Public Function getSV(ByVal str As String) As String&lt;br /&gt;    getSV = Replace(objRequest.ServerVariables(str), &quot;&#39;&quot;, &quot;&#39;&#39;&quot;)&lt;br /&gt;  End Function&lt;br /&gt;&lt;br /&gt;  Public Function log() As Long&lt;br /&gt;    Set objContext = GetObjectContext()&lt;br /&gt;    Set objRequest = objContext(&quot;Request&quot;)&lt;br /&gt;    strQueryString = LCase(getSV(&quot;query_string&quot;))&lt;br /&gt;    strServerName = LCase(getSV(&quot;server_name&quot;))&lt;br /&gt;    strReferrer = LCase(getSV(&quot;http_referer&quot;))&lt;br /&gt;    strIPAddress = getSV(&quot;remote_addr&quot;)&lt;br /&gt;    strBrowser = getSV(&quot;http_user_agent&quot;)&lt;br /&gt;    strNow = FormatDateTime(Now(), vbShortDate) &amp;amp; &quot; &quot;&lt;br /&gt;    strNow = strNow &amp;amp; FormatDateTime(Now(), vbShortTime)&lt;br /&gt;    boolValid = False&lt;br /&gt;    If Len(strQueryString) &amp;gt; 4 Then&lt;br /&gt;      If Left(strQueryString, 4) = &quot;404;&quot; then&lt;br /&gt;        If InStr(strQueryString, &quot;favicon.ico&quot;) &amp;lt;= 0 Then&lt;br /&gt;          strQueryString = Right(strQueryString, Len(strQueryString) - 4)&lt;br /&gt;          boolValid = True&lt;br /&gt;          If InStr(strQueryString, strServerName) &amp;gt; 0 Then&lt;br /&gt;            vntServerName = Split(strQueryString, strServerName)&lt;br /&gt;            strQueryString = vntServerName(1)&lt;br /&gt;          End If&lt;br /&gt;        End If&lt;br /&gt;      End If&lt;br /&gt;    End If&lt;br /&gt;    Set objRequest = Nothing&lt;br /&gt;    Set objContext = Nothing&lt;br /&gt;    If boolValid Then&lt;br /&gt;      strSQL = &quot;exec STrack404&quot;&lt;br /&gt;      strSQL = strSQL &amp;amp; &quot;  @ip  =&#39;&quot; &amp;amp; strIPAddress &amp;amp; &quot;&#39;&quot;&lt;br /&gt;      strSQL = strSQL &amp;amp; &quot;, @url =&#39;&quot; &amp;amp; strQueryString &amp;amp; &quot;&#39;&quot;&lt;br /&gt;      strSQL = strSQL &amp;amp; &quot;, @ref =&#39;&quot; &amp;amp; strReferrer &amp;amp; &quot;&#39;&quot;&lt;br /&gt;      strSQL = strSQL &amp;amp; &quot;, @dt  =&#39;&quot; &amp;amp; strNow &amp;amp; &quot;&#39;&quot;&lt;br /&gt;      strSQL = strSQL &amp;amp; &quot;, @ua  =&#39;&quot; &amp;amp; strBrowser &amp;amp; &quot;&#39;&quot;&lt;br /&gt;      Set objConnection = CreateObject(&quot;adodb.connection&quot;)&lt;br /&gt;      objConnection.open &quot;driver={SQL Server};server=1.1.1.1;database=track404;uid=stats;pwd=xyz&quot;&lt;br /&gt;      objConnection.Execute (strSQL)&lt;br /&gt;      objConnection.Close&lt;br /&gt;      Set objConnection = Nothing&lt;br /&gt;    End If&lt;br /&gt;  End Function&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;That&#39;s it for the code. Select &lt;b&gt;File&lt;/b&gt;, then &lt;b&gt;Make&lt;/b&gt;  Bertrand.dll, and you&#39;re almost set! Now, in case this doesn&#39;t compile  for you right away, code for a batch file is also included that will  allow you to quickly restart IIS and other dependant services. (As  previously noted, once a DLL is attached to IIS, it&#39;s very difficult to  &quot;detach&quot; it.) A shortcut to this batch file is sitting on my taskbar,  which should tell you how often I use it. It is called Restart.bat and  contains the following code:&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-8&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_1658619a-9095-412d-b833-81aff6bb2f3c&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;  net stop iisadmin /y&lt;br /&gt;  net start w3svc&lt;br /&gt;  net start msftpsvc&lt;br /&gt;  net start smtpsvc&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The last two commands are only necessary if you run a File Transfer  Protocol (FTP) service and Simple Mail Transfer Protocol (SMTP) service  (our workstations here, for the most part, only require the first two  lines). Once the Web server has been stopped, you can recompile your DLL  without getting a Permission Denied error.&lt;br /&gt; The final two steps are registering your new DLL and writing the ASP code to call it. Click the &lt;b&gt;Start&lt;/b&gt; button, point to &lt;b&gt;Run&lt;/b&gt;, and type in the following (replace &amp;lt;path&amp;gt; with the absolute path where you saved your DLL):&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-9&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_33301791-3b0d-4b98-8f51-b31d24d6a6d8&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;  regsvr32 &amp;lt;path&amp;gt;\bertrand.dll&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Here&#39;s the ASP code to insert into your custom 404 page:&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-10&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_76be99f5-4dd3-4785-9728-c64d05336ed5&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;  &amp;lt;%&lt;br /&gt;    set track = server.createobject(&quot;bertrand.track404&quot;)&lt;br /&gt;    track.log()&lt;br /&gt;    set track = nothing&lt;br /&gt;  %&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;fig&quot;&gt;Now that may not be everything. Once you port this DLL  to the production server, you may have problems if the correct Visual  Basic run times are not installed. You can get around this either by  using the package and deployment wizard, by installing Visual Basic 6.0,  or (recommended) by installing the Visual Basic 6.0 run time library on  the server (you can &lt;a href=&quot;http://download.microsoft.com/download/vba6/utility/1/win98/en-us/vbrun60sp3.exe&quot;&gt;http://download.microsoft.com/download/vba6/utility/1/win98/en-us/vbrun60sp3.exe&lt;/a&gt; &lt;a href=&quot;http://download.microsoft.com/download/vba6/utility/1/win98/en-us/vbrun60sp3.exe&quot;&gt;Download the run time library here&lt;/a&gt; and read about it in &lt;a href=&quot;http://support.microsoft.com/support/kb/articles/q235/4/20.asp&quot;&gt;VBRun60sp3.exe Installs Visual Basic 6.0 Run-Time Files&lt;/a&gt;).&lt;/div&gt;&lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;404track_topic8&quot;&gt;&lt;/a&gt;Conclusion&lt;/h2&gt;Well,  happy coding. Within no time you should have a stats table full of 404  information, just waiting to be extracted. Here is a sample ASP 404  page, as well as a small sampling of test data retrieved from the SQL  Server database instantly:&lt;br /&gt; &lt;div class=&quot;fig&quot;&gt;&lt;code&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC118693.gif&quot; /&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 4. Sample 404 page&lt;/b&gt;&lt;/div&gt;Stay  tuned for the next article, where I will enhance this component to  provide a viewing and maintenance interface for the stats, and reveal  methodology behind making this application smarter. In the meantime, you  could expand this technique to other kinds of errors.&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;404track_topic9&quot;&gt;&lt;/a&gt;Additional Information&lt;/h2&gt;For  more information on creating ActiveX DLLs with Visual Basic 6.0 and  IIS4+, and creating custom 404 error messages, visit the following  sites:  &lt;br /&gt;&lt;ul type=&quot;disc&quot;&gt;&lt;li&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/ms809958.aspx&quot;&gt;Developing a Visual Basic Component for IIS/MTS&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.swynk.com/friends/bertrand/404error.asp&quot;&gt; Give them a FRIENDLY 404 error&lt;/a&gt; &lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://msdn.microsoft.com/workshop/server/iis/corner033099.asp&quot;&gt;Redirecting Traffic: A Smart Custom 404 Message for IIS 4.0&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;h4 class=&quot;dtH1&quot;&gt;About the Author&lt;/h4&gt;Aaron Bertrand (aaron@desktop.on.ca) is an ASP/SQL developer for BlueStreak.com, Inc., and runs an ASP Tips site at &lt;a href=&quot;http://www.aspfaq.com/&quot;&gt;http://www.aspfaq.com/&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/4849342757599762284/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/creating-404-error-tracker-with-visual.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/4849342757599762284'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/4849342757599762284'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/creating-404-error-tracker-with-visual.html' title='Creating a 404 Error Tracker with Visual Basic 6.0'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-932877040962479059</id><published>2017-03-14T12:30:00.002-07:00</published><updated>2017-03-14T12:30:59.529-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Comparison Between VB 6.0 and VB.NET Objects, Part 2 </title><content type='html'>&lt;span class=&quot;body&quot;&gt;For a more detailed look at which Visual Basic 6.0 Form properties still exist or have changed, visit MSDN &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/z2wd4kbh.aspx&quot; target=&quot;new&quot;&gt;Control Property, Method, and Event Changes for Visual Basic 6.0 Users&lt;/a&gt;.&lt;br /&gt;  &lt;h3&gt;Visual Basic.NET Properties Descriptions and Settings&lt;/h3&gt;&lt;table border=&quot;2&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;&lt;tbody&gt;&lt;tr bgcolor=&quot;#ffff99&quot;&gt;&lt;th&gt;Property Name&lt;/th&gt;&lt;th&gt;Property Description&lt;/th&gt;&lt;th&gt;Property Setting&lt;/th&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformscontrolclassdatabindingstopic.asp&quot;&gt;DataBindings&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Holds all the bindings of properties of this control to data sources&lt;/td&gt;&lt;td&gt;Refer To the DataBindings Advanced property&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;DataBindings Advanced&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Allows you to bind properties of the control&lt;/td&gt;&lt;td&gt;[VBNETDataBindingsAdv.jpg]Use the above picture to assign binding properties to controls&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td colspan=&quot;3&quot;&gt;Uses the DataBindings property to  access the ControlBindingsCollection. By adding Binding objects to the  collection, you can bind any property of a control to the property of an  object.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vboriintroductiontoapplicationsettingstorage.asp&quot; target=&quot;new&quot;&gt;Dynamic Properties&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Maps values in the application configuration file &lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpgrfaccessingappsettingssection.asp&quot; target=&quot;new&quot;&gt; &amp;lt;appSettings&amp;gt;&lt;/a&gt;&lt;/strong&gt; section to this component&#39;s properties&lt;/td&gt;&lt;td&gt;[VBNETDynamicPropertiesAdv.jpg] &lt;div id=&quot;olal-container&quot;&gt;    &lt;div class=&quot;cachedWidget&quot; id=&quot;assetsListings&quot; style=&quot;display: block;&quot;&gt;                            &lt;div id=&quot;assetsListings_listing&quot;&gt;                        &lt;div class=&quot;assetNew&quot; style=&quot;cursor: hand; cursor: pointer;&quot;&gt;                    &lt;div class=&quot;assetNew-icon&quot;&gt;                        &lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;35&quot; src=&quot;http://www.codeguru.com/images/pdfImage.jpg&quot; width=&quot;35&quot; /&gt;                    &lt;/div&gt;&lt;div class=&quot;assetNew-title&quot;&gt;                        10 Things You Need to Know About Deploying Microsoft Office 365                    &lt;/div&gt;&lt;div class=&quot;assetNew-download&quot;&gt;                        &lt;a class=&quot;assetNew-download-link qsctCached bluid_2017031412224318944277001&quot; href=&quot;http://o1.qnsr.com/cgi/r?WT.qs_dlk=WMhDAArIZ7wAAG6RGkQAAAAV;;n=203;c=1395297;s=9479;x=7936;f=201308291424140;u=j;z=TIMESTAMP;k=http://assetform.codeguru.com/controller?asset=206471410&amp;amp;srvid=95910&amp;amp;vkey=9974310&amp;amp;io=226635&amp;amp;BLUID=2017031412224318944277001&amp;amp;qset=CONTACTFORM_HQB&amp;amp;formHQB=y&amp;amp;domain=www.codeguru.com&amp;amp;cfurl=http%3A%2F%2Fwww.codeguru.com%2Fvb%2Fgen%2Fvb_general%2Fideincludingvisualstudionet%2Farticle.php%2Fc11081%2FComparison-Between-VB-60-and-VBNET-Objects-Part-1.htm&quot; rel=&quot;noindex, nofollow&quot;&gt;Download Now&lt;/a&gt;                    &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;When a Box similar to the above picture is displayed, you can set Dynamic Properties for your controls&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Dynamic Properties Advanced&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Advanced Dynamic properties allow you to configure and set key names by which to store any dynamic property values&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;AcceptButton&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;The accept button of the form. If this is set, the button is &#39;clicked&#39; whenever the user presses the &lt;em&gt;&#39;ENTER&#39;&lt;/em&gt; key.&lt;/td&gt;&lt;td&gt;Choose the button you want to select as a Default button from the displayed list&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformscontrolclassaccessibledescriptiontopic.asp&quot; target=&quot;new&quot;&gt;AccessibleDescription&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;An object&#39;s &lt;strong&gt;AccessibleDescription&lt;/strong&gt; property provides  a textual description about an object&#39;s visual appearance. The  description is primarily used to provide greater context for low-vision  or blind users, but also can be used for context searching or other  applications.&lt;/td&gt;&lt;td&gt;Any Textual and Numeric data can be entered here. &lt;strong&gt;Textual is recommended.&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;AccessibleName&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;The &lt;strong&gt;AccessibleName&lt;/strong&gt; property is a label that briefly  describes and identifies the object within its container, such as the  text in a Button, the name of a MenuItem, or a label displayed next to a  TextBox control.&lt;/td&gt;&lt;td&gt;Any Textual and Numeric data can be entered here. &lt;strong&gt;Textual is recommended.&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;AccessibleRole&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;The role of the object describes the function of the object and is used by accessibility applications&lt;/td&gt;&lt;td&gt;[VBNETAccessibleRole.jpg]Choose the applicable Role from the list&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWindowsFormsControlClassAllowDropTopic.asp&quot; target=&quot;new&quot;&gt;AllowDrop&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines whether the control will receive drag-drop notifications&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;AutoScale&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;You can use this property to allow your form and its controls to  automatically adjust based on changes in the font. This can be useful in  applications where the font might increase or decrease based on the  language specified for use by Windows.&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;AutoScroll&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;If this property is set to &lt;strong&gt;True&lt;/strong&gt;, scroll bars are  displayed on the form if any controls are located outside the form&#39;s  client region. Additionally, when autoscrolling is on, the client area  of the form automatically scrolls to make the control with input focus  visible.&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;AutoScrollMargin&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;The margin around controls during auto scroll&lt;br /&gt;The auto-scroll margin is the distance between any child controls and the edges of the scrollable parent control. The &lt;strong&gt;AutoScrollMargin&lt;/strong&gt; size is added to the size of any child controls contained in the  scrollable control to determine whether or not scroll bars are needed.&lt;/td&gt;&lt;td&gt;Integer data &lt;strong&gt;ONLY&lt;/strong&gt; for &lt;strong&gt;Width&lt;/strong&gt; and &lt;strong&gt;Height&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;AutoScrollMinSize&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;The &lt;strong&gt;AutoScrollMinSize&lt;/strong&gt; property is used to manage the screen size allocated to the automatic scroll bars.&lt;/td&gt;&lt;td&gt;Integer data &lt;strong&gt;ONLY&lt;/strong&gt; for &lt;strong&gt;Width&lt;/strong&gt; and &lt;strong&gt;Height&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;BackColor&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;The background color used to display text and graphics in the control&lt;/td&gt;&lt;td&gt;[VBNETBackColorCustom.jpg][VBNETBackColorWeb.jpg]&lt;br /&gt;[VBNETBackColorSystem.jpg]You can select any color from any Tab in the &lt;em&gt;Color&lt;/em&gt; Dialogbox&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;BackgroundImage&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;The background image used for the control&lt;/td&gt;&lt;td&gt;[VBNETBackgroundPicture.jpg]Browse for a picture on your system using the above Dialog box&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;CancelButton&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;This property allows you to designate a default action to occur when the user presses the &lt;em&gt;&#39;ESC&#39;&lt;/em&gt; key in your application. You can use this property to allow the user to  quickly navigate a simple form by allowing them to simply press the  &#39;ESC&#39; key to close a window without committing changes instead of  manually clicking the Cancel button with their mouse.&lt;/td&gt;&lt;td&gt;Choose the button you wish to select as a Default button from the displayed list&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbprocausesvalidationproperty.asp&quot; target=&quot;new&quot;&gt;CausesValidation&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Gets or sets a value indicating whether the control causes  validation to be performed on any controls that require validation when  it receives focus.&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;ContextMenu&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;The shortcut menu to display when the user right-clicks the control&lt;/td&gt;&lt;td&gt;Choose any ContextMenu item (on the Form) from the list&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;ControlBox&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;If the &lt;strong&gt;ControlBox&lt;/strong&gt; property is set to &lt;strong&gt;true&lt;/strong&gt;,  the control box is displayed in the upper-left corner of the caption  bar. The control box is where the user can click to access the system  menu.&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Cursor&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;The cursor that appears when the mouse pointer passes over the control&lt;/td&gt;&lt;td&gt;[VBNETCursor.jpg]Based on your needs, select the appropriate Cursor from the list&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsscrollablecontroldockpaddingedgesclassbottomtopic.asp&quot; target=&quot;new&quot;&gt;DockPadding&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;This determines the size of the border for docked controls&lt;/td&gt;&lt;td&gt;Integer data &lt;strong&gt;ONLY&lt;/strong&gt; for: &lt;ul&gt;&lt;li&gt;&lt;strong&gt;All&lt;/strong&gt; - Number of pixels along all borders to pad docked controls&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Left&lt;/strong&gt; - Number of pixels along the left to pad docked controls&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Top&lt;/strong&gt; - Number of pixels along the top to pad docked controls&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Right&lt;/strong&gt; - Number of pixels along the right to pad docked controls&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Bottom&lt;/strong&gt; - Number of pixels along the right to pad docked controls&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Enabled&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Gets or sets a value indicating whether the control can respond to user interaction&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Font&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;The font used to display text in the control&lt;/td&gt;&lt;td&gt;&lt;strong&gt;[VB6FontSelectionDialogBox.jpg]&lt;/strong&gt;&lt;strong&gt;Name&lt;/strong&gt; [VBNETFontName.jpg]&lt;br /&gt; &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Size&lt;/strong&gt; - Any Numeric value&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Unit&lt;/strong&gt; - World, Pixel, Point, Inch, Document, Millimetre&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Bold&lt;/strong&gt; - True, False&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/system.drawing.font_properties.aspx&quot; target=&quot;new&quot;&gt;GdiCharSet&lt;/a&gt;&lt;/strong&gt; - Integer values &lt;strong&gt;ONLY&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/system.drawing.font_properties.aspx&quot; target=&quot;new&quot;&gt;GdiVerticalFont&lt;/a&gt;&lt;/strong&gt; - True, False&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Italic&lt;/strong&gt; - True, False&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Strikeout&lt;/strong&gt; - True, False&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Underline&lt;/strong&gt; - True, False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;ForeColor&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;The foreground color used to display text and graphics in the control&lt;/td&gt;&lt;td&gt;[VBNETBackColorCustom.jpg][VBNETBackColorWeb.jpg]&lt;br /&gt;[VBNETBackColorSystem.jpg]You can select any color from any Tab in the &lt;em&gt;Color&lt;/em&gt; dialog box&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;FormBorderStyle&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Controls the appearance of the border for the form. This also will  affect how the caption bar is displayed and what buttons are allowed to  appear on it.&lt;/td&gt;&lt;td&gt; &lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Fixed3D&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;A fixed, three-dimensional border.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;FixedDialog&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;A thick, fixed dialog-style border.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;FixedSingle&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;A fixed, single-line border.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;FixedToolWindow&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;A tool window border that is not resizable. A tool window does not  appear in the taskbar or in the window that appears when the user  presses &lt;em&gt;&#39;ALT+TAB&#39;&lt;/em&gt;.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;None&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;No border.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;Sizable&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;A resizable border.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;strong&gt;SizableToolWindow&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;A resizable tool window border. A tool window does not appear in the  taskbar or in the window that appears when the user presses &lt;em&gt;&#39;ALT+TAB&#39;&lt;/em&gt;.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;GridSize&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines the size of the positioning grid&lt;/td&gt;&lt;td&gt;Integer Values &lt;strong&gt;ONLY&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;HelpButton&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;When this property is set to &lt;strong&gt;true&lt;/strong&gt;, a small button  with a question mark appears in the caption bar to the left of the Close  button. You can use this button to display help for your application.  You can create an event handler for the HelpRequested event of the  Control class to display Help information to the user when the Help  button of the form is clicked.&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Icon&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;A form&#39;s icon designates the picture that represents the form in the  taskbar as well as the icon that is displayed for the control box of  the form.&lt;/td&gt;&lt;td valign=&quot;TOP&quot;&gt;[VBNETIcon.jpg]&lt;strong&gt;Unless an icon is selected, the Size sub-properties will be un-editable.&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbgrfIMEModeConstantChangesInVisualBasicNET.asp&quot; target=&quot;new&quot;&gt;ImeMode&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines the IME (Input Method Editor) status of the object when selected An input method editor (IME) is a program that allows users to enter  complex characters and symbols, such as Japanese Kanji characters, using  a standard keyboard. The &lt;strong&gt;ImeMode&lt;/strong&gt; property is typically set to ImeMode.Off for a TextBox control that is intended to only  enter numeric values. The &lt;strong&gt;ImeMode&lt;/strong&gt; property value is set to ImeMode.NoControl for the Form class.&lt;/td&gt;&lt;td&gt;Select any of the following: &lt;ul&gt;&lt;li&gt;Inherit&lt;/li&gt;&lt;li&gt;NoControl&lt;/li&gt;&lt;li&gt;On&lt;/li&gt;&lt;li&gt;Off&lt;/li&gt;&lt;li&gt;Disable&lt;/li&gt;&lt;li&gt;Hiragana&lt;/li&gt;&lt;li&gt;Katakana&lt;/li&gt;&lt;li&gt;KatakanaHalf&lt;/li&gt;&lt;li&gt;AlphaFull&lt;/li&gt;&lt;li&gt;Alpha&lt;/li&gt;&lt;li&gt;HangulFull&lt;/li&gt;&lt;li&gt;Hangul&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;IsMdiContainer&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;This property changes the display and behavior of the form to an MDI parent form. When this property is set to &lt;strong&gt;true&lt;/strong&gt;,  the form displays a sunken client area with a raised border. All MDI  child forms assigned to the parent form are displayed within its client  area.&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;KeyPreview&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;When this property is set to &lt;strong&gt;true&lt;/strong&gt;, the form will  receive all KeyPress, KeyDown, and KeyUp events. After the form&#39;s event  handlers have completed processing the keystroke, the keystroke is then  assigned to the control with focus. You can use this property to process all keystrokes in your  application and either handle the keystroke or call the appropriate  control to handle the keystroke. For example, when an application uses  function keys, you might want to process the keystrokes at the form  level rather than writing code for each control that might receive  keystroke events.&lt;br /&gt; &lt;strong&gt;Note:&lt;/strong&gt; If a form has no visible or enabled controls, it automatically receives all keyboard events.&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Language&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Indicates the current localizable language&lt;/td&gt;&lt;td&gt;List of languages from which to choose&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Location&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;The position of the top-left corner of the control with respect to its container&lt;/td&gt;&lt;td&gt;Integer values for &lt;strong&gt;X&lt;/strong&gt; and &lt;strong&gt;Y&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Locked&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;The Locked property determines whether you can move or resize the control&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;MaximizeBox&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines whether a form has a maximize box in the upper-right corner of its caption bar&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;MaximumSize&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;The maximum size the form can be resized to. This property enables you to limit the size of a form to a specified  maximum size. You can use this feature when displaying multiple windows  at the same time, to ensure that a single window does not cause other  windows to be hidden. If this property is set to a Size object that is 0  in height and 0 in width, the form will have no maximum size beyond the  limits set by Windows.&lt;/td&gt;&lt;td&gt;Integer values for &lt;strong&gt;Width&lt;/strong&gt; and &lt;strong&gt;Height&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Menu&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;You can use this property to switch between complete menu sets at  run time. For example, you can define one MainMenu to be displayed when  your multiple document interface (MDI) form has no active MDI child  forms and another &lt;strong&gt;MainMenu&lt;/strong&gt; to display when a child window is displayed. You can also use a different &lt;strong&gt;MainMenu&lt;/strong&gt; when specific conditions exist in your application that require displaying a different menu set.&lt;/td&gt;&lt;td&gt;Choose from a list of Main Menu controls on the form&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;MinimizeBox&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines whether a form has a minimize box in the upper-right corner of its caption bar&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;MinimumSize&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;The minimum size the form can be resized to. This property enables you to limit the size of a form to a specified  minimum size. You can use this feature to prevent a user from sizing a  window to an undesirable size. If this property is set to a Size object  that is 0 in height and 0 in width, the form will have no minimum size  beyond the limits set by Windows.&lt;/td&gt;&lt;td&gt;Integer values for: &lt;strong&gt;Width&lt;/strong&gt; and &lt;strong&gt;Height&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Name&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Gets or sets the name of the control.&lt;/td&gt;&lt;td&gt;Textual data&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWindowsFormsFormClassOpacityTopic.asp&quot; target=&quot;new&quot;&gt;Opacity&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;This property enables you to specify a level of transparency for the  form and its controls. This property differs from transparency provided  by the TransparencyKey, which only makes a form and its controls  completely transparent if they are the same color as the value specified  in the &lt;strong&gt;TransparencyKey&lt;/strong&gt; property. When this property is  set to a value less than 100% (1.00), the entire form, including  borders, is made more transparent. Setting this property to a value of  0% (0.00) makes the form completely invisible. You can use this property  to provide different levels of transparency or to provide effects such  as phasing a form in or out of view. For example, you can phase a form  into view by setting the &lt;strong&gt;Opacity&lt;/strong&gt; property to a value of 0% (0.00) and gradually increasing the value until it reaches 100% (1.00).&lt;/td&gt;&lt;td&gt;Percentage values Ranging from (&lt;strong&gt;0%&lt;/strong&gt; to &lt;strong&gt;100%&lt;/strong&gt;)&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;RightToLeft&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;The &lt;strong&gt;RightToLeft&lt;/strong&gt; property is used for international  applications where the language is written from right to left, such as  Hebrew or Arabic. When this property is set to RightToLeft.Yes, control  elements that include text are displayed from right to left. If the control is a top-level control, the user&#39;s operating system is  queried to determine whether the control needs to enable right-to-left  support.&lt;br /&gt; The following are a few examples of how control elements are affected by the &lt;strong&gt;RightToLeft&lt;/strong&gt; property value of &lt;strong&gt;RightToLeft.Yes&lt;/strong&gt;:&lt;br /&gt; &lt;ul&gt;&lt;li&gt;Vertical scroll bars are displayed on the left side rather than right side of scrollable controls.&lt;/li&gt;&lt;li&gt;Horizontal scroll bars start with the scroll box (thumb) right-aligned.&lt;/li&gt;&lt;li&gt;The check box element alignment, controlled by the &lt;strong&gt;CheckAlign&lt;/strong&gt; property, is reversed for CheckBox and RadioButton controls.&lt;/li&gt;&lt;li&gt;Text displayed in the title bar of a Form is right-aligned. The icon  and control box retain their left and right alignment respectively.&lt;/li&gt;&lt;li&gt;Items in list box, combo box, and up-down controls are right aligned.&lt;/li&gt;&lt;li&gt;Menus are displayed right-aligned.&lt;/li&gt;&lt;li&gt;The alignment of toolbar buttons on a ToolBar control or the alignment of text on a ToolBarButton is not affected by the &lt;strong&gt;RightToLeft&lt;/strong&gt; property.&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;No&lt;/li&gt;&lt;li&gt;Yes&lt;/li&gt;&lt;li&gt;Inherit&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;ShowInTaskbar&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;You can use this property to prevent users from selecting your form through the Windows taskbar.&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Size&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;This property allows you to set both the height and width of the  form at the same time instead of setting the Height and Width properties  individually.&lt;/td&gt;&lt;td&gt;Integer values for &lt;strong&gt;Width&lt;/strong&gt; and &lt;strong&gt;Height&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;SizeGripStyle&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;This property enables you to determine when the sizing grip is  displayed on the form. You can set this property to display the sizing  grip or have it automatically displayed based on the setting of the  FormBorderStyle property.&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;Auto&lt;/li&gt;&lt;li&gt;Show&lt;/li&gt;&lt;li&gt;Hide&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;SnapToGrid&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines whether controls should snap to the positioning grid&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;StartPosition&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;This property enables you to set the starting position of the form  when it is displayed at run time. The form can be displayed manually or  in the default location specified by Windows.&lt;/td&gt;&lt;td&gt;Select any of the following: &lt;ul&gt;&lt;li&gt;Manual&lt;/li&gt;&lt;li&gt;CenterScreen&lt;/li&gt;&lt;li&gt;WindowsDefaultLocation&lt;/li&gt;&lt;li&gt;WindowsDefaultBounds&lt;/li&gt;&lt;li&gt;CenterParent&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Tag&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;A common use for the &lt;strong&gt;Tag&lt;/strong&gt; property is to store data  that is closely associated with the control. For example, if you have a  control that displays information about a customer you, might store a  DataSet that contains the customer&#39;s order history in that control&#39;s &lt;strong&gt;Tag&lt;/strong&gt; property so the data can be accessed quickly.&lt;/td&gt;&lt;td&gt;Any type derived from the Object class can be assigned to this  property. If the Tag property is set through the Windows Forms designer,  only text can be assigned.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Text&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Gets or sets the text associated with this control.&lt;/td&gt;&lt;td&gt;Textual data and any Numeric data can be entered here.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;TopMost&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;A top-most form is a form that overlaps all the other forms even if it is not the active or foreground form.&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemWindowsFormsFormClassTransparencyKeyTopic.asp&quot; target=&quot;new&quot;&gt;TransparencyKey&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;When the &lt;strong&gt;TransparencyKey&lt;/strong&gt; property is assigned a  Color, the areas of the form that have the same BackColor will be  displayed transparently. Any mouse actions, such as the click of the  mouse, that are performed on the transparent areas of the form will be  transferred to the windows below the transparent area.&lt;/td&gt;&lt;td&gt;[VBNETBackColorCustom.jpg][VBNETBackColorWeb.jpg]&lt;br /&gt;[VBNETBackColorSystem.jpg]You can select any color from any Tab in the &lt;em&gt;Color&lt;/em&gt; dialog box.&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;WindowState&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines the initial visual state of the form&lt;/td&gt;&lt;td&gt;Select any of the following: &lt;ul&gt;&lt;li&gt;Normal&lt;/li&gt;&lt;li&gt;Minimized&lt;/li&gt;&lt;li&gt;Maximized&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;I hope this has made your migration to Visual Basic.NET a tiny bit  easier, and that I have given you enough insight to the Form object  Properties Window changes. Watch for &lt;strong&gt;Part II (Changes in the Toolboxes) of Comparison Between VB 6.0 and VB.NET Objects&lt;/strong&gt;.&lt;br /&gt;  &lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/932877040962479059/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/comparison-between-vb-60-and-vbnet_14.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/932877040962479059'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/932877040962479059'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/comparison-between-vb-60-and-vbnet_14.html' title='Comparison Between VB 6.0 and VB.NET Objects, Part 2 '/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-2000326073129755662</id><published>2017-03-14T12:25:00.000-07:00</published><updated>2017-03-14T12:25:07.918-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Comparison Between VB 6.0 and VB.NET Objects, Part 1</title><content type='html'>&lt;div class=&quot;post-info&quot;&gt;&lt;/div&gt;&lt;span class=&quot;body&quot;&gt;With this article, I want to provide a  detailed explanation of the Form object&#39;s Property Window changes (from  Visual Basic 6.0 to Visual Basic.NET). This will be very useful when you  come from a Visual Basic 6 background. This article is not just aimed  at VB6 veterans but to anyone starting with Visual Basic.NET—as you will  see.&lt;br /&gt;  First off, start with the Visual Basic 6.0 Form property descriptions and settings.&lt;br /&gt;  &lt;h3&gt;Visual Basic 6 Properties Descriptions and their Settings&lt;/h3&gt;Have you ever wondered what all these properties do? I have found  myself seeing a Form property in the Properties Window, and realising—I  haven&#39;t used it before, or I don&#39;t know what exactly that particular  Property does. So, what I&#39;ve done was to compile this list of Visual  Basic 6.0 Form object Properties along with Descriptions and Settings,  which will be a handy reference to anyone using Visual Basic 6.&lt;br /&gt;  &lt;table border=&quot;2&quot; cellpadding=&quot;2&quot; cellspacing=&quot;2&quot;&gt;&lt;tbody&gt;&lt;tr bgcolor=&quot;#ffff99&quot;&gt;&lt;th&gt;Property Name&lt;/th&gt;&lt;th&gt;Property Description&lt;/th&gt;&lt;th&gt;Property Setting&lt;/th&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Appearance&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Returns/Sets whether or not an object is painted at run time with 3-D effects&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;0 - Flat&lt;/li&gt;&lt;li&gt;1 - 3D&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbproAutoRedraw.asp&quot; target=&quot;new&quot;&gt;AutoRedraw&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Returns the output from a graphics method to a persistent bitmap&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;BackColor&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Background color used to display text and graphics in an object&lt;/td&gt;&lt;td&gt;&lt;img alt=&quot;&quot; height=&quot;165&quot; src=&quot;http://www.codeguru.com/images/article/11081/VB6BackColorPalette.jpg&quot; width=&quot;154&quot; /&gt; &lt;img alt=&quot;&quot; height=&quot;169&quot; src=&quot;http://www.codeguru.com/images/article/11081/VB6BackColorSystem.jpg&quot; width=&quot;156&quot; /&gt;  &lt;div id=&quot;olal-container&quot;&gt;    &lt;div class=&quot;cachedWidget&quot; id=&quot;assetsListings&quot; style=&quot;display: block;&quot;&gt;                            &lt;/div&gt;&lt;/div&gt;Choose any color from the appropriate tab in the &lt;em&gt;Color&lt;/em&gt; dialog box&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbproBorderStyle.asp&quot; target=&quot;new&quot;&gt;BorderStyle&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;The Border style for an object&lt;/td&gt;&lt;td&gt;Select any of the following: &lt;ul&gt;&lt;li&gt;0 - None&lt;/li&gt;&lt;li&gt;1 - Fixed Single&lt;/li&gt;&lt;li&gt;2 - Sizable&lt;/li&gt;&lt;li&gt;3 - Fixed Dialog&lt;/li&gt;&lt;li&gt;4 - Fixed ToolWindow&lt;/li&gt;&lt;li&gt;5 - Sizable ToolWindow&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Caption&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Sets the text displayed in a window&#39;s title bar&lt;/td&gt;&lt;td&gt;Textual data can be entered here&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconusingclipcontrols.asp&quot; target=&quot;new&quot;&gt;ClipControls&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines whether graphics methods in Paint events repaint an entire object&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;ControlBox&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines whether the Control&#39;s Menu Box is shown on the left side of the title bar&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbprodrawmodex.asp&quot; target=&quot;new&quot;&gt;DrawMode&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Sets the appearance of output from graphics methods or of a Shape or a Line control&lt;/td&gt; &lt;td&gt;Select any of the following: &lt;ul&gt;&lt;li&gt;1 - Blackness&lt;/li&gt;&lt;li&gt;2 - Not Merge Pen&lt;/li&gt;&lt;li&gt;3 - Mask Not Pen&lt;/li&gt;&lt;li&gt;4 - Not Copy Pen&lt;/li&gt;&lt;li&gt;5 - Mask Pen Not&lt;/li&gt;&lt;li&gt;6 - Invert&lt;/li&gt;&lt;li&gt;7 - Xor Pen&lt;/li&gt;&lt;li&gt;8 - Not Mask Pen&lt;/li&gt;&lt;li&gt;9 - Mask Pen&lt;/li&gt;&lt;li&gt;10 - Not Xor Pen&lt;/li&gt;&lt;li&gt;11 - Nop&lt;/li&gt;&lt;li&gt;12 - Merge Not Pen&lt;/li&gt;&lt;li&gt;13 - Copy Pen&lt;/li&gt;&lt;li&gt;14 - Merge Pen Not&lt;/li&gt;&lt;li&gt;15 - Merge Pen&lt;/li&gt;&lt;li&gt;16 - Whiteness&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbproDrawStyle.asp&quot; target=&quot;new&quot;&gt;DrawStyle&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines the Line Style for output from graphics methods&lt;/td&gt;&lt;td&gt;Select any of the following: &lt;ul&gt;&lt;li&gt;0 - Solid&lt;/li&gt;&lt;li&gt;1 - Dash&lt;/li&gt;&lt;li&gt;2 - Dot&lt;/li&gt;&lt;li&gt;3 - Dash-Dot&lt;/li&gt;&lt;li&gt;4 - Dash-Dot-Dot&lt;/li&gt;&lt;li&gt;5 - Transparent&lt;/li&gt;&lt;li&gt;6 - Inside Solid&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;DrawWidth&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Line width for output from graphics methods&lt;/td&gt;&lt;td&gt;Integer values &lt;strong&gt;ONLY&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Enabled&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines whether a control can respond to user-generated events&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;FillColor&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Color used to fill in shapes, circles, and boxes&lt;/td&gt;&lt;td&gt;&lt;img alt=&quot;&quot; height=&quot;165&quot; src=&quot;http://www.codeguru.com/images/article/11081/VB6BackColorPalette.jpg&quot; width=&quot;154&quot; /&gt; &lt;img alt=&quot;&quot; height=&quot;169&quot; src=&quot;http://www.codeguru.com/images/article/11081/VB6BackColorSystem.jpg&quot; width=&quot;156&quot; /&gt;  Choose any color from the appropriate tab in the &lt;em&gt;Color&lt;/em&gt; dialog box&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbprofillstylex.asp&quot; target=&quot;new&quot;&gt;FillStyle&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Fill style of a shape&lt;/td&gt;&lt;td&gt;Select any of the following: &lt;ul&gt;&lt;li&gt;0 - Solid&lt;/li&gt;&lt;li&gt;1 - Transparent&lt;/li&gt;&lt;li&gt;2 - Horizontal Line&lt;/li&gt;&lt;li&gt;3 - Vertical Line&lt;/li&gt;&lt;li&gt;4 - Upward Diagonal&lt;/li&gt;&lt;li&gt;5 - Downward Diagonal&lt;/li&gt;&lt;li&gt;6 - Cross&lt;/li&gt;&lt;li&gt;7 - Diagonal Cross&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Font&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Returns a Font object&lt;/td&gt;&lt;td&gt;&lt;img alt=&quot;&quot; height=&quot;344&quot; src=&quot;http://www.codeguru.com/images/article/11081/VB6FontSelectionDialogBox.jpg&quot; width=&quot;437&quot; /&gt; Choose desired Font from the displayed Dialogbox&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;ForeColor&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Forecolor used to display text and graphics in an object&lt;/td&gt;&lt;td&gt;&lt;img alt=&quot;&quot; height=&quot;165&quot; src=&quot;http://www.codeguru.com/images/article/11081/VB6BackColorPalette.jpg&quot; width=&quot;154&quot; /&gt; &lt;img alt=&quot;&quot; height=&quot;169&quot; src=&quot;http://www.codeguru.com/images/article/11081/VB6BackColorSystem.jpg&quot; width=&quot;156&quot; /&gt; Choose any color from the appropriate tab in the &lt;em&gt;Color&lt;/em&gt; dialog box&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbproowndcproperty.asp&quot; target=&quot;new&quot;&gt;HasDC&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines whether a unique display context is allocated for the control&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Height&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Height of an object&lt;/td&gt;&lt;td&gt;Integer Values &lt;strong&gt;ONLY&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbproHelpContextID.asp&quot; target=&quot;new&quot;&gt;HelpContextID&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Specifies the default help file context ID of an object&lt;/td&gt;&lt;td&gt;Integer values &lt;strong&gt;ONLY&lt;/strong&gt;; for example: 0&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Icon&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Icon displayed when a form is minimized at run time&lt;/td&gt;&lt;td&gt;&lt;img alt=&quot;&quot; height=&quot;292&quot; src=&quot;http://www.codeguru.com/images/article/11081/VB6LoadIcon.jpg&quot; width=&quot;426&quot; /&gt; Browse for desired Icon&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;KeyPreview&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines whether keyboard events for an object are invoked before keyboard events for controls on that object&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Left&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Distance between the internal left edge of an object and the left edge of its container&lt;/td&gt;&lt;td&gt;Integer values &lt;strong&gt;ONLY&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbproLinkMode.asp&quot; target=&quot;new&quot;&gt;LinkMode&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Type of link used for a &lt;a href=&quot;http://support.microsoft.com/default.aspx?scid=kb;en-us;189498&quot; target=&quot;new&quot;&gt;DDE&lt;/a&gt; conversation and activates the connection&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;0 - None&lt;/li&gt;&lt;li&gt;1 - Manual&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbproLinkTopic.asp&quot; target=&quot;new&quot;&gt;LinkTopic&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Source application and topic for a destination control&lt;/td&gt;&lt;td&gt;Textual data&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;MaxButton&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines whether a form has a Maximize button&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;MDIChild&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines whether a form is displayed inside a &lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconmultipledocumentinterfacemdiapplications.asp&quot; target=&quot;new&quot;&gt;MDI&lt;/a&gt; Parent form&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;MinButton&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines whether a form has a Minimize button&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;MouseIcon&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Sets a custom mouse icon&lt;/td&gt;&lt;td&gt;&lt;img alt=&quot;&quot; height=&quot;292&quot; src=&quot;http://www.codeguru.com/images/article/11081/VB6LoadIcon.jpg&quot; width=&quot;426&quot; /&gt; Browse for desired Icon&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;MousePointer&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Type of mouse pointer displayed when over part of an object&lt;/td&gt;&lt;td&gt;Select any of the following: &lt;ul&gt;&lt;li&gt;0 - Default&lt;/li&gt;&lt;li&gt;1 - Arrow&lt;/li&gt;&lt;li&gt;2 - Cross&lt;/li&gt;&lt;li&gt;3 - I - Beam&lt;/li&gt;&lt;li&gt;4 - Icon&lt;/li&gt;&lt;li&gt;5 - Size&lt;/li&gt;&lt;li&gt;6 - Size NE SW&lt;/li&gt;&lt;li&gt;7 - Size N S&lt;/li&gt;&lt;li&gt;8 - Size NW SE&lt;/li&gt;&lt;li&gt;9 - Size W E&lt;/li&gt;&lt;li&gt;10 - Up Arrow&lt;/li&gt;&lt;li&gt;11 - Hourglass&lt;/li&gt;&lt;li&gt;12 - No Drop&lt;/li&gt;&lt;li&gt;13 - Arrow and Hourglass&lt;/li&gt;&lt;li&gt;14 - Arrow and Question&lt;/li&gt;&lt;li&gt;15 - Size All&lt;/li&gt;&lt;li&gt;99 - Custom&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Moveable&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines whether a form can be moved&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Name&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Name of the form&lt;/td&gt;&lt;td&gt;Textual data&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbproNegotiateMenus.asp&quot; target=&quot;new&quot;&gt;NegotiateMenus&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines whether a form incorporates the menus from an object on the form&#39;s menu bar&lt;/td&gt;&lt;td valign=&quot;TOP&quot;&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbproOLEDropModeProperty.asp&quot; target=&quot;new&quot;&gt;OLEDropMode&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines whether this object can act as an OLE object&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;0 - None&lt;/li&gt;&lt;li&gt;1 - Manual&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Palette&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Image that contains the palette to use on an object when PaletteMode is set to Custom&lt;/td&gt;&lt;td&gt;&lt;img alt=&quot;&quot; height=&quot;292&quot; src=&quot;http://www.codeguru.com/images/article/11081/VB6LoadPallette.jpg&quot; width=&quot;426&quot; /&gt; Browse for desired Palette&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;PaletteMode&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Value that determines which palette to use for controls on an object&lt;/td&gt;&lt;td&gt;Select any of the following: &lt;ul&gt;&lt;li&gt;0 - Halftone&lt;/li&gt;&lt;li&gt;1 - UseZOrder&lt;/li&gt;&lt;li&gt;2 - Custom&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Picture&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Graphic to be displayed on the control&lt;/td&gt;&lt;td&gt;&lt;img alt=&quot;&quot; height=&quot;292&quot; src=&quot;http://www.codeguru.com/images/article/11081/VB6LoadPicture.jpg&quot; width=&quot;426&quot; /&gt; Browse for Picture to use on Form&#39;s Background&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;RightToLeft&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Text display direction and control visual appearance on a bidirectional system&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;ScaleHeight&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;The number of units for the vertical measurement of a object&#39;s interior&lt;/td&gt;&lt;td&gt;Any Numeric value&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;ScaleLeft&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Horizontal coordinates for the left edges of an object&lt;/td&gt;&lt;td&gt;Any Numeric value&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbproscalemodex.asp&quot; target=&quot;new&quot;&gt;ScaleMode&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Value indicating measurement units for object coordinates when using graphics methods or positioning controls&lt;/td&gt;&lt;td&gt;Select any of the following: &lt;ul&gt;&lt;li&gt;0 - User&lt;/li&gt;&lt;li&gt;1 - Twip&lt;/li&gt;&lt;li&gt;2 - Point&lt;/li&gt;&lt;li&gt;3 - Pixel&lt;/li&gt;&lt;li&gt;4 - Character&lt;/li&gt;&lt;li&gt;5 - Inch&lt;/li&gt;&lt;li&gt;6 - Millimetre&lt;/li&gt;&lt;li&gt;7 - Centimetre&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;ScaleTop&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Vertical coordinates for the top edges of an object&lt;/td&gt;&lt;td&gt;Any Numeric value&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;ScaleWidth&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Number of units for the Horizontal measurement of an object&#39;s interior&lt;/td&gt;&lt;td&gt;Any Numeric value&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;ShowInTaskbar&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines whether a form or MDIForm appears in the Windows taskbar.&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/html/vbproStartUpPositionProperty.asp&quot;&gt;StartUpPosition&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Value specifying the position of a form when it first appears&lt;/td&gt;&lt;td&gt;Select any of the following: &lt;ul&gt;&lt;li&gt;0 - Manual&lt;/li&gt;&lt;li&gt;1 - CenterOwner&lt;/li&gt;&lt;li&gt;2 - CenterScreen&lt;/li&gt;&lt;li&gt;3 - Windows Default&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;&lt;a href=&quot;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcmn/html/vbproTagPropertyActiveXControls.asp&quot; target=&quot;new&quot;&gt;Tag&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Stores any extra data needed for your program&lt;/td&gt;&lt;td&gt;Any Textual and Numeric data&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Top&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Distance between the internal top edge of an object and the top edge of its container&lt;/td&gt;&lt;td&gt;Integer Values &lt;strong&gt;ONLY&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Visible&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines whether the object is visible or hidden&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;WhatsThisButton&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Determines whether the What&#39;s This Button appears in the title bar of a form or MDI form&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;WhatsThisHelp&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Context-sensitive help uses the What&#39;s This popup provided by Windows Help&lt;/td&gt;&lt;td&gt;&lt;ul&gt;&lt;li&gt;True&lt;/li&gt;&lt;li&gt;False&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;Width&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Width of an object&lt;/td&gt;&lt;td&gt;Integer Values &lt;strong&gt;ONLY&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;TOP&quot;&gt;&lt;td&gt;&lt;strong&gt;WindowState&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;Visual state of a form at run time&lt;/td&gt;&lt;td&gt;Select any of the following: &lt;ul&gt;&lt;li&gt;0 - Normal&lt;/li&gt;&lt;li&gt;1 - Minimized&lt;/li&gt;&lt;li&gt;2 - Maximized &lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/2000326073129755662/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/comparison-between-vb-60-and-vbnet.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/2000326073129755662'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/2000326073129755662'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/comparison-between-vb-60-and-vbnet.html' title='Comparison Between VB 6.0 and VB.NET Objects, Part 1'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-3891420329686008975</id><published>2017-03-14T12:20:00.001-07:00</published><updated>2017-03-14T12:20:57.891-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Microsoft Visual Basic 6.0 Migration Resource Center</title><content type='html'>&lt;h1&gt;&lt;/h1&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;img align=&quot;left&quot; alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/en-us/vstudio/ms788233.VB6_diagram400%28en-us,MSDN.10%29.png&quot; title=&quot;&quot; width=&quot;110px&quot; /&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;Microsoft’s Commitment to VB 6.0 Customers&lt;/strong&gt;-  Microsoft is committed to helping Visual Basic 6.0 customers upgrade to  .NET and preserve existing assets. Visual Studio shipped a Visual Basic  6.0 project migration wizard through 2008 in all Visual Studio SKUs.  While Microsoft no longer ships the migration wizard, our  &lt;a href=&quot;https://msdn.microsoft.com/en-us/ms788231.aspx&quot;&gt;partners are offering free migration tools and solutions&lt;/a&gt;. Here are  more resources to help answer questions on how to migrate from Visual  Basic 6.0 to Visual Basic .NET and Visual Studio 2010.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div&gt;&lt;div class=&quot;BostonPostCard&quot; id=&quot;&quot;&gt;&lt;h3&gt;Migration Resources&lt;/h3&gt;&lt;/div&gt;&lt;div class=&quot;VCR_Container&quot; id=&quot;c_486857ec4ec94c3e8506d93317b32d20&quot; style=&quot;width: 600px;&quot;&gt;  &lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;height: 250px; width: 600px;&quot;&gt;    &lt;tbody&gt;&lt;tr style=&quot;height: 100%; width: 100%;&quot;&gt;      &lt;td align=&quot;left&quot; style=&quot;width: 100px;&quot; valign=&quot;top&quot;&gt;                       &lt;div class=&quot;VCR_Label VCR_Label_Selected&quot; style=&quot;width: 100px;&quot;&gt;              Prepare &amp;gt;             &lt;/div&gt;&lt;div class=&quot;VCR_Label&quot; style=&quot;width: 100px;&quot;&gt;              Migrate &amp;gt;             &lt;/div&gt;&lt;div class=&quot;VCR_Label&quot; style=&quot;width: 100px;&quot;&gt;              Test &amp;gt;             &lt;/div&gt;&lt;div class=&quot;VCR_Label&quot; style=&quot;width: 100px;&quot;&gt;              Modernize &amp;gt;             &lt;/div&gt;&lt;/td&gt;      &lt;td align=&quot;left&quot; style=&quot;height: 100%;&quot; valign=&quot;top&quot;&gt;        &lt;div style=&quot;height: 100%; position: relative; width: 100%;&quot;&gt;&amp;nbsp;                        &lt;div class=&quot;VCR_ContentItem&quot; style=&quot;display: block;&quot;&gt;              &lt;h3 id=&quot;prepare&quot;&gt;Prepare&lt;/h3&gt;The first step in a phased  migration to .NET is to assess which upgrade strategy is right for you  in order to come up with a migration plan.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa480541.aspx&quot;&gt;Patterns &amp;amp; Practices Guidance: Upgrading Visual Basic 6 Applications to Visual Basic .NET&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://www.microsoft.com/downloads/details.aspx?FamilyId=10C491A2-FC67-4509-BC10-60C5C039A272&amp;amp;displaylang=en&quot;&gt;Visual Basic 6.0 to Visual Basic .NET Upgrade Assessment Tool&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://www.microsoft.com/downloads/details.aspx?FamilyID=a656371a-b5c0-4d40-b015-0caa02634fae&amp;amp;DisplayLang=en&quot;&gt;Code Advisor for Visual Basic 6.0&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/vbrun/cc297223.aspx&quot;&gt;Essential Training Videos for Visual Basic 6 Developers&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;Click the tab on the left for information on the next step: Migrate&lt;/strong&gt;&lt;br /&gt;             &lt;/div&gt;&lt;/div&gt;&lt;/td&gt;    &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;BostonPostCard&quot; id=&quot;&quot;&gt;&lt;h3&gt;More Resources&lt;/h3&gt;&lt;/div&gt;&lt;h3&gt;Guidance&lt;/h3&gt;&lt;ul class=&quot;bulletedlist&quot;&gt;&lt;li&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa480541.aspx&quot; title=&quot;VB6 Upgrade Guidance from Patterns and Practices&quot;&gt;VB6 Upgrade Guidance from Patterns and Practices&lt;/a&gt;&lt;br /&gt;Provides proven practices to reach functional equivalence while upgrading Visual Basic 6 to Visual Basic .NET.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/vbrun/ms788236.aspx&quot; title=&quot;Upgrading Microsoft Visual Basic 6 to Microsoft Visual Basic.NET&quot;&gt;Upgrading Microsoft Visual Basic 6 to Microsoft Visual Basic.NET&lt;/a&gt;&lt;br /&gt;This free book is the complete technical guide to upgrading Visual Basic 6 applications to Visual Basic .NET.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Training&lt;/h3&gt;&lt;ul class=&quot;bulletedlist&quot;&gt;&lt;li&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/vstudio/cc297223&quot; title=&quot;VB6 Essential Training Videos&quot;&gt;VB6 Essential Training Videos&lt;/a&gt;&lt;br /&gt;Complete series of training videos that give Visual Basic 6 developers the skills to start developing on the .NET platform.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://download.microsoft.com/download/8/a/0/8a0a43fb-4f1c-43c1-bd40-f294b1a54ba3/7.2.wmv&quot; title=&quot;VB6 Upgrade Assesment Webcast&quot;&gt;VB6 Upgrade Assesment Webcast&lt;/a&gt;&lt;br /&gt;This webcast gives the framework to develop the right strategy to take advantage of the .NET Framework.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Tools for Code Preparation&lt;/h3&gt;&lt;ul class=&quot;bulletedlist&quot;&gt;&lt;li&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/vstudio/ms788231&quot; title=&quot;Partner Tools &amp;amp; Solutions&quot;&gt;Partner Tools &amp;amp; Solutions&lt;/a&gt;&lt;br /&gt;Leverage these free tools and  solutions from our partners to assist you with a more complete migration  from Visual Basic 6 to .NET.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://www.microsoft.com/downloads/details.aspx?FamilyID=a656371a-b5c0-4d40-b015-0caa02634fae&amp;amp;DisplayLang=en&quot; title=&quot;Code Advisor for Visual Basic 6.0&quot;&gt;Code Advisor for Visual Basic 6.0&lt;/a&gt;&lt;br /&gt;Add-in used to ensure that code meets predetermined coding standards and best practices developed by Microsoft.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://www.microsoft.com/downloads/details.aspx?FamilyId=10C491A2-FC67-4509-BC10-60C5C039A272&amp;amp;displaylang=en&quot; title=&quot;Visual Basic 6.0 to Visual Basic .NET Upgrade Assessment Tool&quot;&gt;Visual Basic 6.0 to Visual Basic .NET Upgrade Assessment Tool&lt;/a&gt;&lt;br /&gt;Analyze your Visual Basic 6.0 projects to determine what issues you will need to address to be able to upgrade.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Tools for Full and Phased Migration &lt;/h3&gt;&lt;ul class=&quot;bulletedlist&quot;&gt;&lt;li&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/vstudio/ms788231&quot; title=&quot;Partner Tools &amp;amp; Solutions&quot;&gt;Partner Tools &amp;amp; Solutions&lt;/a&gt;&lt;br /&gt;Leverage these free tools and  solutions from our partner to assist you with a more complete migration  from Visual Basic 6 to .NET.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/bb419144.aspx&quot; title=&quot;Interop Forms Toolkit&quot;&gt;Interop Forms Toolkit&lt;/a&gt;&lt;br /&gt;Used to enable phased migration, this  free add-in for Visual Studio simplifies the process of displaying .NET  forms and controls in a Visual Basic 6 application.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://msdn.microsoft.com/bb735936.aspx&quot; title=&quot;Visual Basic Power Packs&quot;&gt;Visual Basic Power Packs&lt;/a&gt;&lt;br /&gt;Contains a set of controls to use in  .NET forms that are familiar to Visual Basic 6 developers. It includes a  DataRepeater control, Line and Shape controls, a PrintForm component,  and a Printer Compatibility.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/3891420329686008975/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/microsoft-visual-basic-60-migration_14.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/3891420329686008975'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/3891420329686008975'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/microsoft-visual-basic-60-migration_14.html' title='Microsoft Visual Basic 6.0 Migration Resource Center'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-6686078541922476771</id><published>2017-03-14T12:16:00.001-07:00</published><updated>2017-03-14T12:16:23.288-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Visual Basic 6.0 Downloads</title><content type='html'>&lt;div class=&quot;MainColumn&quot;&gt;&lt;div class=&quot;BostonPostCard&quot; id=&quot;&quot;&gt;&lt;h3&gt;Essential Downloads&lt;/h3&gt;&lt;table class=&quot;headlines_table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;headlines_td_image&quot; valign=&quot;top&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;headlines_td_text&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;https://www.microsoft.com/downloads/details.aspx?FamilyID=a656371a-b5c0-4d40-b015-0caa02634fae&amp;amp;DisplayLang=en&quot; title=&quot;Code Advisor for Visual Basic 6.0&quot;&gt;Code Advisor for Visual Basic 6.0&lt;/a&gt;&lt;br /&gt;This application plugs-in to Visual Basic 6.0 to analyze your code and suggest possible improvements.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;headlines_td_image&quot; valign=&quot;top&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;headlines_td_text&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;https://www.microsoft.com/downloads/details.aspx?FamilyId=10C491A2-FC67-4509-BC10-60C5C039A272&amp;amp;displaylang=en&quot; title=&quot;Visual Basic 6.0 to Visual Basic .NET Upgrade Assessment Tool&quot;&gt;Visual Basic 6.0 to Visual Basic .NET Upgrade Assessment Tool&lt;/a&gt;&lt;br /&gt;Analyze your Visual Basic 6.0 projects to determine what issues you will need to address to be able to upgrade.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;headlines_td_image&quot; valign=&quot;top&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;headlines_td_text&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/vstudio/bb419144&quot; title=&quot;Interop Forms Toolkit 2.1&quot;&gt;Interop Forms Toolkit 2.1&lt;/a&gt;&lt;br /&gt;Used to enable phased migration,  this free add-in for Visual Studio simplifies the process of displaying  .NET forms and controls in a Visual Basic 6 application.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;headlines_td_image&quot; valign=&quot;top&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;headlines_td_text&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/vstudio/bb735936&quot; title=&quot;Visual Basic Power Packs&quot;&gt;Visual Basic Power Packs&lt;/a&gt;&lt;br /&gt;Contains a set of controls to use in  .NET forms that are familiar to Visual Basic 6 developers. It includes a  DataRepeater control, Line and Shape controls, a PrintForm component,  and a Printer Compatibility.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;BostonPostCard&quot; id=&quot;&quot;&gt;&lt;h3&gt;Additional Downloads&lt;/h3&gt;&lt;a href=&quot;https://www.microsoft.com/downloads/details.aspx?familyid=cb824e35-0403-45c4-9e41-459f0eb89e36&amp;amp;displaylang=en&quot;&gt;Microsoft Visual Basic 6.0 Service Pack 6 Cumulative Update&lt;/a&gt;&lt;br /&gt;A  security issue has been identified that could allow an attacker to  compromise your Windows-based system running Microsoft Visual Basic 6.0  Service Pack 6 and gain complete control over it. You can help protect  your computer by installing this update from Microsoft.&lt;br /&gt; &lt;a href=&quot;https://www.microsoft.com/downloads/details.aspx?familyid=83BF08E6-012D-4DB2-8109-20C8D7D5C1FC&amp;amp;displaylang=en&quot;&gt;Service Pack 6 for Visual Basic 6.0&lt;/a&gt;&lt;br /&gt;Service Pack 6 for Visual  Basic 6.0 provides the latest updates to Visual Basic 6.0. It is  recommended for all users of Visual Basic 6.0.&lt;br /&gt; &lt;a href=&quot;https://www.microsoft.com/downloads/details.aspx?familyid=7b9ba261-7a9c-43e7-9117-f673077ffb3c&amp;amp;displaylang=en&quot;&gt;Service Pack 6 for Visual Basic 6.0: Run-Time Redistribution Pack&lt;/a&gt;&lt;br /&gt;vbrun60sp6.exe  is a self-extracting executable file that installs versions of the  Microsoft Visual Basic run-time files required by all applications  created with Visual Basic 6.0.&lt;br /&gt; &lt;a href=&quot;https://www.microsoft.com/downloads/details.aspx?familyid=25437d98-51d0-41c1-bb14-64662f5f62fe&amp;amp;displaylang=en&quot;&gt;Microsoft Visual Basic 6.0 Common Controls&lt;/a&gt;&lt;br /&gt;Update for the Microsoft Visual Basic 6.0 Common Controls: mscomctl.ocx and comctl32.ocx.&lt;br /&gt; &lt;a href=&quot;https://www.microsoft.com/downloads/details.aspx?familyid=ef463b3a-ef97-454d-839e-7668c1113022&amp;amp;displaylang=en&quot;&gt;Visual Basic 6.0 Upgrade Samples&lt;/a&gt;&lt;br /&gt;Download these Microsoft Visual  Basic samples to learn more about upgrading your application from Visual  Basic 6.0 to Visual Basic .NET. Each sample contains three projects -  one in Visual Basic 6 and two in Visual Basic .NET. The two Visual Basic  .NET samples show the range of options available in upgrading your  applications.&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/vstudio/ee410535&quot;&gt;Additional Visual Basic 5.0 and 6.0 Samples&lt;/a&gt;&lt;br /&gt;Download additional controls, components and samples for Visual Basic 5.0 and 6.0.&lt;br /&gt; &lt;a href=&quot;https://www.microsoft.com/downloads/details.aspx?familyid=a8494edb-2e89-4676-a16a-5c5477cb9713&amp;amp;displaylang=en&quot;&gt;Visual SourceSafe 6.0 Service Pack 6&lt;/a&gt;&lt;br /&gt;Microsoft Visual SourceSafe®  6.0 Service Pack 6 (SP6) provides the latest performance and  reliability updates to the Visual SourceSafe version control system.  Service Pack 6 contains the upgrade to Visual SourceSafe 6.0c and is  highly recommended for all Visual SourceSafe 6.0 users, including those  also running Visual Studio .NET Professional or Visual Basic .NET  Standard.&lt;br /&gt; &lt;a href=&quot;http://support.microsoft.com/?kbid=234526&amp;amp;sd=msdn&quot;&gt;PRB: Visual SourceSafe 6.0 SP3 Netsetup Installation Problem&lt;/a&gt;&lt;br /&gt;The  Visual C++ 6.0 Processor Pack provides intrinsic support for enhanced  instruction sets supported by Intel and Advanced Micro Devices (AMD)  processors. The instructions sets supported are Intel&#39;s Pentium III new  instruction sets (Streaming SIMD Extensions [SSE]) and Intel&#39;s Pentium 4  new instruction sets (Streaming SIMD Extensions 2 [SSE2]) as well as  AMD&#39;s 3DNow! Instruction sets. The Processor Pack is available as a  download.&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/vs2005/aa718352.aspx&quot;&gt;Microsoft Visual Studio: Installer 1.1&lt;/a&gt;&lt;br /&gt;Microsoft Visual Studio  Installer 1.1 is the latest update to the graphical tool that simplifies  the creation of application setup programs for distribution to  single-user or enterprise-wide desktops. New with Visual Studio  Installer 1.1 is side-by-side installation of versioned DLLs. &amp;nbsp;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/vs2005/aa718356.aspx&quot;&gt;Microsoft Visual Studio: T-SQL Debugger Buffer Overrun Fix&lt;/a&gt;&lt;br /&gt;Visual  Studio 6.0 Enterprise contains a Microsoft Visual Basic feature for  debugging T-SQL. This feature contains a problem that could cause a  buffer overrun. Since the default installation of the &lt;strong&gt;Debugger&lt;/strong&gt; object allows anyone to start the debugger and run as the logged on  interactive user, this bug potentially could be exploited with malicious  intentions.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/6686078541922476771/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/visual-basic-60-downloads.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/6686078541922476771'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/6686078541922476771'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/visual-basic-60-downloads.html' title='Visual Basic 6.0 Downloads'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-8930420254493572187</id><published>2017-03-14T12:13:00.003-07:00</published><updated>2017-03-14T12:13:50.785-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Additional Visual Basic 5.0 &amp; 6.0 Samples</title><content type='html'>&lt;h1&gt;&lt;/h1&gt;These are  additional Visual Basic 5.0 and 6.0 samples, controls, utilities and  components. Samples marked with &quot;VB6&quot; are intended to be run only in  Visual Basic 6.0 and those marked with &quot;VB5&quot; are intended for Visual  Basic 5.0 only. All samples on this page that offer a single file  download are Intel-x86 versions. Samples that offer two file downloads  provide a choice of Intel-x86 (listed first) or Alpha (listed second)  versions. &lt;br /&gt;&lt;table class=&quot;noimages&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/ProjUpgd.EXE&quot; title=&quot;ActiveX Control Upgrade Utility (VB6)&quot;&gt;ActiveX Control Upgrade Utility (VB6)&lt;/a&gt;&lt;br /&gt;This utility will  upgrade your Visual Basic 5.0 and pre-release 6.0 projects to use the  latest Visual Basic 6.0 ActiveX controls. Specifically this utility will  update any project that contains any of the following ActiveX controls:  COMCTL32.OCX, COMCT232.OCX, MSChart.OCX. &lt;strong&gt;Note:&lt;/strong&gt; Before using this utility you should backup your Visual Basic 5.0 projects. Do not convert projects using binary compatibility.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/SyncCmp6.EXE&quot; title=&quot;Binary Compatibility Add-in&quot;&gt;Binary Compatibility Add-in&lt;/a&gt;&lt;br /&gt;This download includes the  document &quot;Revised Binary Compatibility&quot; as well as the Add-in  SyncCompt.dll. Binary Compatibility as implemented in Visual Basic 5.0  and Visual Basic 6.0 ensures that new versions of shipping products are  fully compatible with older versions. The document explains issues  around Binary Compatibility and GUID revision and introduces the DLL.  The DLL add-in builds a new compatibility file to stabilize your product  (except Standard EXE&#39;s which do not have binary compatibility). This  tool only works in an Microsoft Windows NT® environment.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/SoftBttn.exe&quot; title=&quot;Visual Basic Soft Button Sample&quot;&gt;Visual Basic Soft Button Sample&lt;/a&gt;&lt;br /&gt;The soft button control mimics  the behavior of the buttons in the Microsoft Office 97 toolbar. The  soft button control will paint a specified bitmap, using the user  provided mask color. When the button is disabled, it will apply the  &quot;embossed&quot; or &quot;disabled&quot; effect to the picture. The soft button only has  a 3D edge when the mouse pointer is over it or when it has received  focus through keystrokes.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/WebBttns.exe&quot; title=&quot;Visual Basic Web Button Sample&quot;&gt;Visual Basic Web Button Sample&lt;/a&gt;&lt;br /&gt;Web Buttons are ActiveX  controls that allow web developers to create interesting, unique user  interfaces. They bridge the gap between the immediate response of an  HTML form button, and the smooth, graphical look of a client-side image  map.&lt;br /&gt;Web Buttons have a gradient texture that mimics the  appearance of the textured molded plastic buttons used on car stereos  and remote controls. This effect is achieved by creating a custom,  gradient bitmap that is stretched at run time to fit the button.&lt;br /&gt;One  kind of Web Button is the &quot;push button,&quot; which is a rounded button with  a charcoal gray, matte finish. It has separate captions for each state  (True/False) that can be displayed in any color that the system  supports. An ellipse around the edge of the button smooths the jagged  edges of the gradient bitmap. Like the caption, this ellipse can be any  available color.&lt;br /&gt;The &quot;rocker button,&quot; an elliptical object with a  charcoal gray, matte finish, is another Web Button. Inside the  elliptical object there are three regions. The upper region is a  thumbnail-shaped button that contains a sunken, triangle-shaped LED. The  middle region contains the button&#39;s caption, which can be any available  color. This region is not clickable. The lower region is a  thumbnail-shaped button that contains a sunken, triangle-shaped LED. An  ellipse around the edge of the button smooths the jagged edges of the  gradient bitmap. Like the caption, this circle can be any available  color. When you click on either button, the LED in that region lights  up.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/Dial.exe&quot; title=&quot;Visual Basic Dial Sample&quot;&gt;Visual Basic Dial Sample&lt;/a&gt;&lt;br /&gt;The Dial control is a circular slider  control, similar to a volume knob found on a stereo system. The Dial  control has two modes: limited and non-limited.&lt;br /&gt;In limited mode,  the &quot;min&quot; and &quot;max&quot; values determine the limits possible within one  revolution. The dial can be turned only one revolution. In the  non-limited mode, the &quot;min&quot; and &quot;max&quot; values set the range of the dial  in one revolution.&lt;br /&gt;The dial can be turned unlimited revolutions.  The limited mode could be used to adjust a value between two extremes  say 1 and 100. The non-limited mode could be used to determine how much  adjustment is possible in the margins of a page. Each revolution could  equal one inch.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/DirWalk.exe&quot; title=&quot;Visual Basic Dir Walk Sample&quot;&gt;Visual Basic Dir Walk Sample&lt;/a&gt;&lt;br /&gt;The Directory Walking Control  (Dir Walk) is an OCX which can be used as either a control placed on a  form, or as a standalone ActiveX server using the CreateObject method.  It is used to collect information from a directory tree. Whenever a file  matching the specified criteria is found, it fires an &quot;ItemFound&quot;  event. It will continue to walk the tree until either the entire drive  is searched, or the fCancel parameter on the ItemFound event is set to  True.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/LED.exe&quot; title=&quot;Visual Basic LED Sample&quot;&gt;Visual Basic LED Sample&lt;/a&gt;&lt;br /&gt;The LED control emulates an LED  (light-emitting diode), such as those found in digital clocks and  displays. The seven-segment display can be used to indicate numeric or  user-defined values.&lt;br /&gt;Developers can either set the display by  assigning the numeric number to the value, or set a mask value, and the  display will only show the segments that the mask specifies. This allows  the user to create unique display items, such as an underline or dash,  that are not defined by a numeric value.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/ICtxMenu.exe&quot; title=&quot;Visual Basic IContextMenu Shell Extension Sample&quot;&gt;Visual Basic IContextMenu Shell Extension Sample&lt;/a&gt;&lt;br /&gt;IContextMenu  Shell Extension is a sample that demonstrates how to build a Visual  Basic 5.0 DLL that creates, implements, and registers three system  interfaces (IShellExtInit, IContextMenu, and IDataObject) that interact  with Windows Explorer.&lt;br /&gt;This sample shell extension enhances the  shell by adding custom commands to the context menu for all .ini files.  Sample code for an INI file viewer has been provided that is run by the  shell extension when the user right clicks over any file with the .ini  extension and selects the option to view INI file. This sample uses the  new Visual Basic 5 Implements feature to create system callable  interfaces.&lt;br /&gt;Note: This sample requires the release version of Visual Basic 5.0 Professional or Enterprise Edition.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/SysTray.exe&quot; title=&quot;Visual Basic SysTray Sample&quot;&gt;Visual Basic SysTray Sample&lt;/a&gt;&lt;br /&gt;The SysTray ActiveX control (.ocx)  demonstrates how to add icons to the taskbar status area of Windows and  how to process callback messages for taskbar icons. The application&#39;s  callback messages are received and processed in a basic module that is  registered as a callback function in a Win32 API call by using the new  Visual Basic 5.0 AddressOf feature.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/DataEx32.exe&quot; title=&quot;Visual Basic Data Access Explorer&quot;&gt;Visual Basic Data Access Explorer&lt;/a&gt;&lt;br /&gt;The Data Access Explorer  (DAE) provides Visual Basic developers with the ability to evaluate the  different data access options provided by Visual Basic 5.0.&lt;br /&gt;Using  queries and sample data provided by the National Software Testing  Laboratories, developers can select a combination of queries, data  sources, query methods, and database engine options to explore Visual  Basic&#39;s data access capabilities. As tests are completed, DAE displays  the time required for each data access option. Those results can be  viewed from within the DAE test window or as a text file.&lt;br /&gt;An &quot;Export To Excel&quot; option is provided for those using Excel.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;Visual Component Manager&lt;br /&gt;Visual  Component Manager is a tool for publishing, organizing, searching, and  sorting reusable Visual Basic components such as controls, designers,  samples, templates, and wizards.&lt;br /&gt;You can use the Component Manager  to publish components you author to a wider audience. You can also  organize all your components in one place and easily search attributes  such as keywords, property values, descriptive text, etc.&lt;br /&gt;The Component Manager is implemented on the Microsoft Repository. V1.0.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Intel:  &lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/VCompMgi.exe&quot;&gt;VCompMgI.exe&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Alpha:  &lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/VCompMgA.exe&quot;&gt;VCompMgA.exe&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/VM11Eng.EXE&quot; title=&quot;Microsoft Visual Modeler&quot;&gt;Microsoft Visual Modeler&lt;/a&gt;&lt;br /&gt;Visual Modeler is a graphical object  modeling tool that is tightly integrated with Microsoft Visual Basic  5.0. Visual Modeler allows you to fulfill the promise of object-oriented  programming by quickly and easily creating applications that are  maintainable, have a long lifetime, and are comprised of components that  can be reused in other applications.&lt;br /&gt;These are the main features of Visual Modeler:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Class  diagrams where you describe the design of the system you are about to  develop in terms of a model, using a high level of abstraction.&lt;/li&gt;&lt;li&gt;Code generation lets you automatically generate Visual Basic code from the design model you have created with Visual Modeler.&lt;/li&gt;&lt;li&gt;Reverse engineering lets you automatically create or update the model with changes made to the Visual Basic code.&lt;/li&gt;&lt;li&gt;Round-trip engineering which is the combination of modeling, code generation, coding, and reverse engineering.&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/IntroVM.EXE&quot; title=&quot;Introduction to Microsoft Visual Modeler.doc&quot;&gt;Introduction to Microsoft Visual Modeler.doc&lt;/a&gt;&lt;br /&gt;Visual Modeler is  available from either the Microsoft Visual Studio or Microsoft Visual  Basic Owner&#39;s Areas. This paper describes how Microsoft Visual Modeler  works in either the Microsoft Visual Studio or Microsoft Visual Basic  Enterprise Editions. Microsoft Visual Modeler is a tool to help  visualize application component designs. It is capable of reverse-  engineering existing Visual Basic applications to create a model. Or,  starting from an existing model, it can build the Visual Basic prototype  code used to implement a model.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/MAM.exe&quot; title=&quot;Microsoft Active Messaging&quot;&gt;Microsoft Active Messaging&lt;/a&gt;&lt;br /&gt;Microsoft Active Messaging  (formerly called OLE Messaging) is an object ../Library for building  messaging and collaboration applications. It is a technology designed to  simplify the creation of applications with messaging functionality, or  to add messaging functionality to existing applications.&lt;br /&gt;For  example, Active Messaging enables you add script to a Visual Basic  application or web site to provide support for creating, sending, and  receiving e-mail as well as participating in discussions and other  public folder applications.&lt;br /&gt;Active Messaging does not represent a  new messaging model, but rather is an additional scripting interface to  the Messaging Application Programming Interface (MAPI) model.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/chrtsamp.exe&quot; title=&quot;Visual Basic MSChart Sample&quot;&gt;Visual Basic MSChart Sample&lt;/a&gt;&lt;br /&gt;The MSChart control allows you to  plot data in charts according to your specifications. Create a chart by  setting data in the control&#39;s properties page, or by retrieving data  from another an external source, such as a Microsoft Excel spreadsheet.  Use the GetObject method to reference the path to the Excel workbook  that contains the worksheet.&lt;br /&gt;The MSChart control has many visible  parts, all of which can be programmed. Use the MSChart control&#39;s  three-dimensional chart features to lend a certain sparkle to a report.  In order to see these features, you must either set the ChartType  property to a valid 3D type, or set the Chart3D property to True.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/AbSplash.exe&quot; title=&quot;Visual Basic About/Splash Sample&quot;&gt;Visual Basic About/Splash Sample&lt;/a&gt;&lt;br /&gt;The Visual Basic About/Splash  sample is a form combining the functionality of an About Box and a  Splash Screen into one form. Since the majority of information contained  in these two forms is usually identical, it makes sense to combine the  forms to reduce coding and provide uniformity. The form also has  optional parameters of User Name and User Info. This allows the  programmer to pass program-specific registration information, which  might be different from the user information stored in the system  registry.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/docdebug.exe&quot; title=&quot;Visual Basic ActiveX Document Debugger Sample&quot;&gt;Visual Basic ActiveX Document Debugger Sample&lt;/a&gt;&lt;br /&gt;The Visual Basic  ActiveX Document Debugger Sample is a utility that works directly with  the VB5 IDE. It&#39;s purpose is to ease the development process for ActiveX  Document developers. It does this by acting as a dockable ToolWindow  that provides automatic loading and unloading of ActiveX Documents into  selected hosts.&lt;br /&gt;The ActiveX Document Debugger provides two drop  down combo boxes and two buttons. The comboboxes load a selected ActiveX  document into one of three hosts. The buttons start and stop the  process.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/PntTool.exe&quot; title=&quot;Visual Basic Paint Effects Tool Sample&quot;&gt;Visual Basic Paint Effects Tool Sample&lt;/a&gt;&lt;br /&gt;The Paint Effects Tool  contains a PaintEffects class that provides methods for painting  transparent and disabled (embossed) images. The sample includes a  demonstration of all methods.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/Wiper.exe&quot; title=&quot;Visual Basic Debug Wiper Sample&quot;&gt;Visual Basic Debug Wiper Sample&lt;/a&gt;&lt;br /&gt;This feature clears the  Immediate Window with the click of a button. Installing this Add-In adds  a button to the Standard Toolbar and a menu item to the Add-Ins menu.  The sample code must be compiled and registered in order to create this  feature.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/win32api.exe&quot; title=&quot;Changes to the Visual Basic API Viewer data&quot;&gt;Changes to the Visual Basic API Viewer data&lt;/a&gt;&lt;br /&gt;Changes have been  made to the API Viewer data. Download Win32api.exe which contains these  changes. After you&#39;ve downloaded the file to your machine double click  on it. It will be decompressed and copied to the correct folder.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/VB5Docs.exe&quot; title=&quot;Visual Basics Docs folder from VB 5.0 CD (VB5)&quot;&gt;Visual Basics Docs folder from VB 5.0 CD (VB5)&lt;/a&gt;&lt;br /&gt;Microsoft  Visual Studio owners have access to these docs in Books Online. They do  not have the documents which were included on the Microsoft Visual  Basics CD in the Docs folder. &lt;br /&gt;If you want the doc files which are easier to print, download this file.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/EventSpy.exe&quot; title=&quot;Visual Basic Event-Spy Add-in Sample&quot;&gt;Visual Basic Event-Spy Add-in Sample&lt;/a&gt;&lt;br /&gt;The Visual Basic  Event-Spy sample is an Add-In for the VB5.0 development environment. It  can be used to more clearly identify where and when IDE Events are  triggered.&lt;br /&gt;The sample code must be compiled and registered in order to create this feature.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;Visual Basic Template Manager Add-In&lt;br /&gt;This  is an update to the Add-In that was shipped on the CD under  /Tools/Unsupported. The Template Manager is a Visual Basic Add-In which  provides three new template types to Visual Basic. With the Template  Manager, you can use Code Templates, Menu Templates, and Control Set  Templates. These templates are copied to the \Template folder beneath  the Visual Basic root folder. They are accessed in the same manner as  you would create any other template.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Intel:  &lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/TmplMgr.exe&quot;&gt;TmplMgr.exe&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Alpha:  &lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/TmplMgrA.exe&quot;&gt;TmplMgrA.exe&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/datatree.exe&quot; title=&quot;Visual Basic Data Tree Control Sample&quot;&gt;Visual Basic Data Tree Control Sample&lt;/a&gt;&lt;br /&gt;This control allows you  to display the database schema for an Access MDB file in a treeview.  Simply by setting the DatabaseName property you will fill the treeview  with a list of the tables, queries, properties, fields, and indexes in  the database. You can then browse the schema, rename objects, and modify  property values. You can also right click to get a context menu that  allows you to open a different database, refresh the treeview or, browse  the data in a table.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/SysColor.EXE&quot; title=&quot;Visual Basic System Color Control Sample&quot;&gt;Visual Basic System Color Control Sample&lt;/a&gt;&lt;br /&gt;This sample is a  scrollable ListView-type collection of the current Windows System  Colors. It could be easily modified to display icons, bitmaps, or  whatever you have in mind. It currently displays a 3D box filled with a  system color next to each system color name. It is mostly hard-coded,  using only a scroll bar, so it is very flexible and lightweight.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/PropPick.exe&quot; title=&quot;Visual Basic Picture and Color Picker Sample&quot;&gt;Visual Basic Picture and Color Picker Sample&lt;/a&gt;&lt;br /&gt;The PropPick.dll  contains the PropertyPicker class, which wraps the  OleCreatePropertyFrame API with the property pages CStockColorPage and  CStockPicturePage that come in Msstkprp.dll. You can use these property  pages in a UserControl, by simply adding them to the UserControl&#39;s  PropertyPages property. To invoke the pages in code, the  OleCreatePropertyFrame API must be called to provide a modal property  page frame.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/DbgWProc.exe&quot; title=&quot;Visual Basic Dbgwproc.dll&quot;&gt;Visual Basic Dbgwproc.dll&lt;/a&gt;&lt;br /&gt;The DbgWProc.Dll (Debug Object for  AddressOf Subclassing) enables you to debug normally while a subclass is  active without adding any unnecessary overhead to your finished product  or distributing an extra component.&lt;br /&gt;Subclassing is a technique  that enables you to intercept Windows messages being sent to a form or  control. By intercepting these messages, you can then write your own  code to change or extend the behavior of the object. VB5 provides the  AddressOf keyword, which can be used to reroute Windows messages to your  own message processing procedure. Subclassing using the AddressOf is  very efficient, but makes debugging a project difficult. If the window  you are subclassing receives a message when you are in break mode, VB  will crash.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/codeflow.exe&quot; title=&quot;CodeFlow - Visual Basic Object Library Sample&quot;&gt;CodeFlow - Visual Basic Object Library Sample&lt;/a&gt;&lt;br /&gt;CodeFlow is a  sample code library. Its mission is to aid in situations where the flow  of code is somewhat problematic or unusual. Some of the code is complex,  using Win32 APIs. Other code is very simple. The uniting factor is that  these code snippets, wrapped into well-behaved interfaces, can greatly  simplify the task of writing code with a demanding flow of execution.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;RegObj.dll - ActiveX Manipulation of the Registry&lt;br /&gt;RegObj.dll  is an ActiveX server that allows Visual Basic developers to  programmatically control the Registry without having to resort to the  Windows API. Included is a document which discusses the object model of  RegObj.dll, and includes some Visual Basic code to illustrate using the  objects in the server to perform common types of registry manipulation.  Although the code in the article is constructed in Visual Basic, any  other language capable of constructing ActiveX client applications, such  as Java or C/C++ can use this ActiveX DLL.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Intel:  &lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/regobji.exe&quot;&gt;RegObjI.exe&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Alpha:  &lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/ResEditA.exe&quot;&gt;RegObjA.exe&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;Visual Basic Resource Editor (VB5)&lt;br /&gt;Notepad is no longer the only editor for your resource files! You can use the Resource Editor, a &lt;em&gt;Visual Basic 5.0&lt;/em&gt; add-in.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Intel:  &lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/ResEditI.EXE&quot;&gt;ResEditI.exe (VB5)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Aplha:  &lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/ResEditA.exe&quot;&gt;ResEditA.exe (VB5)&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;Anything that you need to do to a  resource file (short of editing bitmaps &amp;amp; cursors) can be done in  the Resource Editor, operating entirely within the Visual Basic  integrated development environment.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;Visual Basic CoolBar Control&lt;br /&gt;The  Visual Basic Coolbar Control is a container control that allows you to  create user-configurable toolbars similar to those found in Microsoft  Internet Explorer 3.0. It consists of a collection of one or more  resizable regions or bands. Each band can host a single child control.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Intel:  &lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/comct33i.EXE&quot;&gt;Comct33I.exe&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Alpha:  &lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/ComCt33a.EXE&quot;&gt;Comct33A.exe&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/NameView.EXE&quot; title=&quot;Visual Basic Name View Sample&quot;&gt;Visual Basic Name View Sample&lt;/a&gt;&lt;br /&gt;This sample demonstrates an active-x control that displays its own name at design time and is invisible at run time.&lt;br /&gt;Example  of use: Why would a developer want to use this code? Suppose you&#39;ve  created a control which is invisible at run-time, such as a Timer or an  ImageList. Such controls often simply display an icon at design time. If  you have a large number of such controls on your form, it can be quite a  bit of work to determine which one is which, to make sure that you&#39;ve  set properties on the correct control, etc. With this code, each control  will clearly identify itself by name, preventing any such confusion.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/HotTrack.EXE&quot; title=&quot;Visual Basic Hot Tracking Sample&quot;&gt;Visual Basic Hot Tracking Sample&lt;/a&gt;&lt;br /&gt;One of the new UI elements in  Windows is hot tracking. This means that objects may activate as soon  as the mouse moves over them, then deactivate when the mouse moves off.  Or, they may activate after the mouse has hovered over them for a little  while. Or, they may activate at one level as soon as the mouse moves  over them, then activate at a higher level after a pause, once again  deactivating after the mouse moves off.&lt;br /&gt;Take for example, the  new-style toolbar buttons: As soon as you move over them, they activate,  drawing a border around them. Then, after a pause, they activate at a  higher level by showing a ToolTip. When the mouse moves off, they  deactivate, erasing the border and the ToolTip. This sample code helps  developers to implement this behavior.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/CoolBSmp.EXE&quot; title=&quot;Visual Basic CoolBar Control Sample&quot;&gt;Visual Basic CoolBar Control Sample&lt;/a&gt;&lt;br /&gt;The COOLBAR.VBP sample  application contain tips and tricks on how to use the Coolbar control in  COMCT332.OCX. COOLBAR.VBP is a sample VB5 project that demonstrates how  to create an application with a user interface similar to Internet  Explorer 3.x. The code is loaded with comments describing various tips,  tricks, and techniques for using the coolbar with other controls.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/iobjsaf.exe&quot; title=&quot;Visual Basic IObjectSafety Interface Sample&quot;&gt;Visual Basic IObjectSafety Interface Sample&lt;/a&gt;&lt;br /&gt;ObjSafety.Dll and  ucObjSafety.OCX both implement the IObjectSafety interface, which  exposes functionality to Internet Explorer 3.x&#39;s Safe For Scripting and  Safe For Initialization Security features. This sample contains code  which will allow you to compile both items.&lt;br /&gt;IObjectSafety should  be implemented by objects that have interfaces which support &quot;untrusted&quot;  clients (for example, scripts). It allows the owner of the object to  specify which interfaces need to be protected from untrusted use.  Examples of interfaces that might be protected in this way are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;IID_IDispatch - &quot;Safe for automating with untrusted automation client or script&quot;&lt;/li&gt;&lt;li&gt;IID_IPersist* - &quot;Safe for initializing with untrusted data&quot;&lt;/li&gt;&lt;li&gt;IID_IActiveScript - &quot;Safe for running untrusted scripts&quot;&lt;/li&gt;&lt;/ul&gt;* anything starting with IPersist&lt;br /&gt;Two  HTML samples have been included to demonstrate the use and testing of  the ObjSafety.dll and ucObjSafety.OCX sample Visual Basic projects.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;Visual Basic Application Wizard Update (VB5)&lt;br /&gt;The  Application Wizard lets you generate an application using one of the  predefined visual interfaces - Multiple Document Interface (MDI), Single  Document Interface (SDI), or Explorer Style.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Intel:  &lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/AppWzrdi.EXE&quot;&gt;AppWzrdI.exe (VB5)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Alpha:  &lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/AppWzrda.EXE&quot;&gt;AppWzrdA.exe (VB5)&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;The application you generate contains  a toolbar and a status bar. The default toolbar for SDI and MDI forms  is similar to a Microsoft Office toolbar. It includes the New, Open,  Save, Print, Cut, Copy, Paste, Bold, Italic, Underline, Align Left,  Align Right, and Center buttons.&lt;br /&gt;Explorer-style applications have a  default toolbar with the Navigation Buttons, Cut, Copy, Paste, Delete,  Properties, View Large Icon, View Small Icon, View List, and View  Details buttons. You can customize the toolbar. The status bar includes  information about the status of the application and the date and time.&lt;br /&gt;This Upgrade Contains:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Completely customizable menus with persistence between sessions&lt;/li&gt;&lt;li&gt;A Toolbar Builder which builds a Toolbar when you drop one on a form&lt;/li&gt;&lt;li&gt;Integration with the Data Form Wizard to allow more user-specific database scenarios&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;Visual Basic Data Form Wizard Update (VB5)&lt;br /&gt;The  Data Form Wizard is designed to automatically generate Visual Basic  forms that contain individual bound controls and procedures used to  manage information derived from database tables and queries.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Intel:  &lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/DataFrmi.EXE&quot;&gt;DataFrmI.exe (VB5)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Alpha:  &lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/DataFrma.EXE&quot;&gt;DataFrmA.exe (VB5)&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;You can use the Data Form Wizard to  create either single query forms to manage the data from a single table  or simple query, or Master/Detail type forms used to manage more complex  one-to-many data relationships. If you are using a control, you can  also create a grid or datasheet type form.&lt;br /&gt;The Data Form Wizard is used in conjunction with either the Data or the RemoteData controls, or DAO or RDO code.&lt;br /&gt;This Upgrade Contains:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; Ability to build code-only forms where controls are not bound to a data control&lt;/li&gt;&lt;li&gt; Use of DAO or RDO code depending on database type&lt;/li&gt;&lt;li&gt; Integration with the App Wizard&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;Visual Basic Class Builder Utility Update (VB5)&lt;br /&gt;The  Class Builder utility helps you build your class and collection  hierarchy for your Visual Basic project. The Class Builder utility keeps  track of the hierarchy of your classes and collections and generates  the framework code necessary to implement the classes and collections,  including the properties, methods, events, and enums.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Intel:  &lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/ClsBldi.EXE&quot;&gt;ClsBldI.exe (VB5)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Alpha:  &lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/ClsBlda.EXE&quot;&gt;ClsBldA.exe (VB5)&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;This Upgrade Contains:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Addition of Enums&lt;/li&gt;&lt;li&gt;Addition of ParamArray, Optional, ByVal, and Default values in argument list&lt;/li&gt;&lt;li&gt;Bug fixes&lt;/li&gt;&lt;li&gt;Enums appear only on the All tab.&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class=&quot;noimages_td&quot; valign=&quot;top&quot;&gt;Visual Basic Setup Wizard Update (VB5)&lt;br /&gt;The  Setup Wizard is a tool used with the Visual Basic Setup Toolkit that  helps you create application setup and distribution media. You can also  use the Setup Wizard to create dependency (.dep) files.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Intel:  &lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/Setupwzi.EXE&quot;&gt;SetupWzI.exe (VB5)&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Alpha:  &lt;a href=&quot;http://download.microsoft.com/download/E/A/A/EAAF9632-4137-464F-8706-974D823F80C3/Setupwza.EXE&quot;&gt;SetupWzA.exe (VB5)&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;The Setup Wizard supports:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Multiple floppy disks, and it can split files that are too large to fit onto a single floppy.&lt;/li&gt;&lt;li&gt;Copying your files to a hard disk directory for distribution over a network or on CD-ROM.&lt;/li&gt;&lt;li&gt;Distribution  of your application across the Internet using automatic code download  from Microsoft Internet Explorer, Version 3.0.&lt;/li&gt;&lt;/ul&gt;&lt;strong&gt;Note:&lt;/strong&gt; The Setup Wizard is designed for Visual Basic developers and isn&#39;t a general Windows Setup Tool.&lt;br /&gt;This Upgrade Contains:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Bug fixes to the Setup Wizard that was released with VB 5.0&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/8930420254493572187/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/additional-visual-basic-50-60-samples.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/8930420254493572187'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/8930420254493572187'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/additional-visual-basic-50-60-samples.html' title='Additional Visual Basic 5.0 &amp; 6.0 Samples'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-4913829006104757530</id><published>2017-03-14T12:07:00.000-07:00</published><updated>2017-03-14T12:07:03.828-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Visual Basic 6.0 Resource Center</title><content type='html'>&lt;h1&gt;&lt;/h1&gt;Find the best content for Visual Basic 6 development, .NET interoperability, and migration here.&lt;br /&gt;&lt;table class=&quot;headlines_table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;headlines_td_image&quot; valign=&quot;top&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;headlines_td_text&quot; valign=&quot;top&quot;&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/vstudio/ms788231&quot; title=&quot;Partner Tools &amp;amp; Solutions&quot;&gt;Partner Tools &amp;amp; Solutions&lt;/a&gt;&lt;br /&gt;Leverage these free tools and  solutions from our partners to assist you with a more complete migration  from Visual Basic 6 to .NET.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;BostonPostCard&quot; id=&quot;&quot;&gt;&lt;h3&gt;Getting Started&lt;/h3&gt;&lt;ul class=&quot;bulletedlist&quot;&gt;&lt;li&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/vstudio/ee413549&quot; title=&quot;Microsoft Support Strategy &quot;&gt;1. Migration &amp;amp; Support Strategy &lt;/a&gt;&lt;br /&gt;Key Visual Basic 6.0  runtime files, used in the majority of application scenarios, are  shipping in and supported for the lifetime of Windows 7. Find out what  support options are available to you.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/vstudio/ms788232&quot; title=&quot;Visual Basic 6.0 Resources&quot;&gt;2. Visual Basic 6.0 Resources&lt;/a&gt;&lt;br /&gt;You will find plenty of  resources here for developing in Visual Basic 6.0 including links to the  MSDN Library, technical articles, and code samples.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/vstudio/ms788241&quot; title=&quot; Extend Your Visual Basic 6.0 Applications&quot;&gt;3. Extend Your Visual Basic 6.0 Applications&lt;/a&gt;&lt;br /&gt;Extend your  Visual Basic 6.0 applications using the functionality of Visual Basic  .NET without upgrading. These resources show you how.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/vstudio/ms788233&quot; title=&quot;Upgrading from Visual Basic 6.0&quot;&gt;4. Upgrading from Visual Basic 6.0&lt;/a&gt;&lt;br /&gt;Do you need help in  upgrading your Visual Basic 6.0 applications to Visual Basic .NET? This  section provides the necessary resources.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/4913829006104757530/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/visual-basic-60-resource-center_14.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/4913829006104757530'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/4913829006104757530'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/visual-basic-60-resource-center_14.html' title='Visual Basic 6.0 Resource Center'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-5983827535944756097</id><published>2017-03-14T11:57:00.003-07:00</published><updated>2017-03-14T11:57:21.259-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Visual Basic Concepts Visual Basic Documentation Map</title><content type='html'>&lt;div class=&quot;topic&quot;&gt;&lt;br /&gt;Visual  Basic includes many documentation tools, each designed to help you  learn and use a particular aspect of the product. The documentation  provided with Visual Basic is listed below.&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa716285.aspx&quot;&gt;Programmer&#39;s Guide&lt;/a&gt;&lt;br /&gt; &lt;div class=&quot;tl&quot;&gt;A  guide to creating applications with Visual Basic. Explains programming  techniques, using frequent examples to show how the techniques work in  typical applications.&lt;/div&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa231215.aspx&quot;&gt;Using ActiveX Controls&lt;/a&gt;&lt;br /&gt; &lt;div class=&quot;tl&quot;&gt;An  introduction to the ActiveX controls — formerly called OLE controls —  included with the Visual Basic Professional and Enterprise editions.  Start here for general information, scenarios of real-life uses, and  code. Included in the &lt;i&gt;Component Tools Guide&lt;/i&gt;.&lt;/div&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa262304.aspx&quot;&gt;Creating ActiveX Components&lt;/a&gt;&lt;br /&gt; &lt;div class=&quot;tl&quot;&gt;A  guide to creating ActiveX controls, ActiveX documents, and ActiveX code  components (formerly OLE servers). Includes introductory step-by-step  chapters as well as in-depth design guides. Included in the &lt;i&gt;Component Tools Guide&lt;/i&gt;.&lt;/div&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa241699.aspx&quot;&gt;Extending the Visual Basic Environment with Add-Ins&lt;/a&gt;&lt;br /&gt; &lt;div class=&quot;tl&quot;&gt;A  guide to using the Visual Basic extensibility object model to tailor  the development environment to your unique needs. Use objects in the  model to build add-ins that automate repetitive tasks, monitor the  development environment for certain events, or perform complex tasks.  Included in the &lt;i&gt;Component Tools Guide&lt;/i&gt;.&lt;/div&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa261278.aspx&quot;&gt;Accessing DLLs and the Windows API&lt;/a&gt;&lt;br /&gt; &lt;div class=&quot;tl&quot;&gt;A  guide to enhancing functionality provided by Visual Basic by calling  functions in dynamic-link libraries (DLLs). Through DLLs, you can access  the thousands of procedures that form the backbone of the Microsoft  Windows operating system, as well as routines written in other  languages. Included in the &lt;i&gt;Component Tools Guide&lt;/i&gt;.&lt;/div&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa261159.aspx&quot;&gt;Introduction to Internet Applications&lt;/a&gt;&lt;br /&gt; &lt;div class=&quot;tl&quot;&gt;An  introduction to creating applications that can run on the Internet or  an intranet, presenting HTML pages inside forms-based applications, and  deploying these applications and other ActiveX components on the Web.  Included in the &lt;i&gt;Component Tools Guide&lt;/i&gt;.&lt;/div&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa716175.aspx&quot;&gt;Data Access Guide&lt;/a&gt;&lt;br /&gt; &lt;div class=&quot;tl&quot;&gt;A guide to creating and manipulating databases using Microsoft ActiveX Data Objects (ADO) and other data access technologies.&lt;/div&gt;&lt;div class=&quot;tl&quot;&gt;Provides  a complete reference for features available in all editions of Visual  Basic. Includes sections on the programming language, controls, the  development environment, and more.&lt;/div&gt;&lt;div class=&quot;tl&quot;&gt;Describes the sample applications provided with Visual Basic.&lt;/div&gt;&lt;div class=&quot;tl&quot;&gt;Provides  an overview and complete reference for Data Access Objects, a  programming model that allows you to programmatically access and  manipulate data in local or remote databases, and to manage databases,  their objects and their structure.&lt;/div&gt;&lt;div class=&quot;tl&quot;&gt;A guide to  using Microsoft Repository, an extensible object modeling system that  allows full programmatic access via Automation objects. Microsoft  Repository comes with the Repository Add-in, a Visual Basic add-in  module that automatically stores and maintains the structure of your  Visual Basic projects in an object-oriented data repository.&lt;/div&gt;&lt;h3&gt;Other Documentation&lt;/h3&gt;You may find the following sets of documentation useful; these are located elsewhere in the MSDN™ library.&lt;br /&gt;  &lt;div class=&quot;indent&quot;&gt;Provides introductory material about ASP.&lt;/div&gt;&lt;div class=&quot;indent&quot;&gt;Internet Information Services are a platform for creating ASP pages and developing Web applications. &lt;/div&gt;&lt;span class=&quot;unresolvedLink&quot;&gt;Web Workshop&lt;/span&gt; (formerly known as &quot;Internet Client SDK&quot;)&lt;br /&gt; &lt;div class=&quot;indent&quot;&gt;Contains  information about a variety of technologies that Microsoft has  developed to facilitate development of Internet applications and  content, including dynamic HTML.&lt;/div&gt;&lt;div class=&quot;indent&quot;&gt;Provides information about ActiveX Data Objects (ADO), OLE DB, and Open Database Connectivity (ODBC).&lt;/div&gt;&lt;div class=&quot;tl&quot;&gt;Provides  information about the Microsoft Repository, which produces a common  place to persist information about objects and relationships between  them. &lt;/div&gt;&lt;div class=&quot;indent&quot;&gt;This toolkit covers Transact-SQL, programming ODBC for SQL, and much more.&lt;/div&gt;&lt;div class=&quot;indent&quot;&gt;Microsoft  Transaction Server (MTS) is a component-based transaction processing  system for developing, deploying, and managing high-performance,  scalable, and robust enterprise, Internet, and intranet server  applications. &lt;/div&gt;&lt;div class=&quot;indent&quot;&gt;A guide to using the  Database Designer and Query Designer to create data-driven applications  that rely on live connections to Microsoft SQL Server databases.&lt;/div&gt;&lt;div class=&quot;tl&quot;&gt;Explains how to use the Help browser and find information in the Microsoft Developer Network Library.&lt;/div&gt;&lt;div class=&quot;indent&quot;&gt;Describes a tool that stores, organizes, and shares reusable components.&lt;/div&gt;&lt;div class=&quot;tl&quot;&gt;A  guide to using Visual SourceSafe, an easy-to-use tool for storing  files, controlling access to files, and maintaining multiple versions of  files.&lt;/div&gt;&lt;div class=&quot;indent&quot;&gt;A guide to distributed application  development for business-critical data management. This book includes  information on designing solutions based on a flexible architecture,  developing large-scale data access strategies, and creating integrated  solutions with Visual Studio tools.&lt;/div&gt;Under Books in the table of contents, you can also find &lt;i&gt;Advanced Microsoft Visual Basic 5&lt;/i&gt;, &lt;i&gt;Hardcore Visual Basic&lt;/i&gt;, &lt;i&gt;Internet Programming with Visual Basic 5.0&lt;/i&gt;, and the &lt;i&gt;Microsoft Jet Database Engine Programmer&#39;s Guide&lt;/i&gt;.&lt;br /&gt;  &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/5983827535944756097/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/visual-basic-concepts-visual-basic.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/5983827535944756097'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/5983827535944756097'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/visual-basic-concepts-visual-basic.html' title='Visual Basic Concepts Visual Basic Documentation Map'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-1735115104034788571</id><published>2017-03-14T11:40:00.001-07:00</published><updated>2017-03-14T11:40:05.789-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Great Migrations Studio (gmStudio)</title><content type='html'>gmStudio&amp;nbsp;is a unique  system re-engineering environment for developing scalable, custom  VB6/ASP/COM to .NET upgrade solutions. &amp;nbsp;&amp;nbsp;As a comprehensive software  re-engineering platform, gmStudio helps you plan, customize, improve,  verify, and track your upgrade process and meet the unique requirements  of your source code and your .NET standards. &amp;nbsp;If you are looking towards  preserving and enhancing the value of your VB6/ASP/COM assets, gmStudio  is the most advanced and cost-effective solution available.&lt;br /&gt;&lt;h2&gt;The Tool-Assisted Rewrite&lt;/h2&gt;gmStudio offers&amp;nbsp;&lt;strong&gt;compiler-as-a-service&lt;/strong&gt;&amp;nbsp;capabilities to enable an agile&amp;nbsp;&lt;strong&gt;Tool-Assisted Rewrite Methodology.&lt;/strong&gt; This methodology&amp;nbsp;accelerates your upgrade efforts without sacrificing  quality or control.&amp;nbsp;Project teams using our tools and methods can  deliver a lot more upgrade, better, and faster.&lt;br /&gt;&lt;table class=&quot;multicol&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;innercol&quot; style=&quot;width: 200px;&quot; valign=&quot;top&quot;&gt;&lt;div style=&quot;width: 95px;&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/id-id/vstudio/dn569303.check%28en-us,msdn.10%29.png&quot; /&gt; Agile&lt;br /&gt;&lt;br /&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/id-id/vstudio/dn569303.check%28en-us,msdn.10%29.png&quot; /&gt; Scalable&lt;br /&gt;&lt;br /&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/id-id/vstudio/dn569303.check%28en-us,msdn.10%29.png&quot; /&gt; Improvable&lt;br /&gt;&lt;br /&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/id-id/vstudio/dn569303.check%28en-us,msdn.10%29.png&quot; /&gt; Incremental&lt;br /&gt;&lt;br /&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/id-id/vstudio/dn569303.check%28en-us,msdn.10%29.png&quot; /&gt; Repeatable&lt;br /&gt;&lt;br /&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/id-id/vstudio/dn569303.check%28en-us,msdn.10%29.png&quot; /&gt; Measurable&lt;br /&gt;&lt;/div&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot;&gt;&lt;div class=&quot;BostonPostCard&quot;&gt;&lt;div&gt;&lt;img alt=&quot;&quot; height=&quot;209&quot; src=&quot;https://i-msdn.sec.s-msft.com/id-id/vstudio/dn569303.gmMethodology%28en-us,msdn.10%29.png&quot; width=&quot;500&quot; /&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;h2&gt;Important Offer for You!&lt;/h2&gt;Microsoft  and Great Migrations have partnered to offer a free gmStudio license to  you. The link below can be used to obtain a free copy of gmStudio that  will allow you to upgrade an application of up to 10,000 lines of VB6  code to VB.NET or C#. &amp;nbsp;This promotional offer can also be applied as a  discount when purchasing a larger license, or a license for our &lt;strong&gt;ASP upgrade&lt;/strong&gt; tool.&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.greatmigrations.com/en/resources/gmstudio-promotion.aspx&quot;&gt;&lt;strong&gt;Learn more and Download a free version of gmStudio&lt;/strong&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.greatmigrations.com/en/resources/gmstudio-promotion.aspx&quot;&gt;Click to request gmStudio Promotional Edition for systems with up to 10,000 lines of VB6 code!&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;569&quot; src=&quot;https://i-msdn.sec.s-msft.com/id-id/vstudio/dn569303.gmStudio%28en-us,MSDN.10%29.png&quot; width=&quot;600&quot; /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;https://portal.greatmigrations.com/display/GMG/User%20Interface&quot;&gt;See more gmStudio Screen shots.&lt;/a&gt;&lt;/div&gt;&lt;h2&gt;Benefits&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Cash-in your legacy software assets:&amp;nbsp;&lt;/strong&gt;use gmStudio to help you &quot;cash in&quot; your legacy assets by upgrading them to .NET.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Get more upgrade for your money: &amp;nbsp;&lt;/strong&gt;generate code that&amp;nbsp;takes advantage of .NET.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Rewrite to your standards:&amp;nbsp;&lt;/strong&gt;use .NET APIs and design patterns for lower total cost of ownership and agility after the upgrade. &amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Integrate manual development: &amp;nbsp;&lt;/strong&gt;automatically integrate hand-written code fragments, methods or entire files.&amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Upgrade enterprise applications:&amp;nbsp;&lt;/strong&gt;upgrade large, complex systems made up of many inter-related VB6/ASP/COM components.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Continue maintenance in parallel with the upgrade: &amp;nbsp;&lt;/strong&gt;our methodology does not require a code freeze. &amp;nbsp;&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Get valuable results quickly:&amp;nbsp;&lt;/strong&gt;gmStudio facilitates an agile approach to migration that delivers .NET code iteratively.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Build quality in and up:&amp;nbsp;&lt;/strong&gt;the gmStudio approach is test-driven and improves code quality systematically and incrementally.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Document and reuse your solutions:&amp;nbsp;&lt;/strong&gt;each gmStudio solution is documented and reusable.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Plan and estimate more effectively:&amp;nbsp;&lt;/strong&gt;gmStudio&#39;s customizable code analysis reports help you plan your upgrade strategies.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Measure and track progress:&amp;nbsp;&lt;/strong&gt;&amp;nbsp;gmStudio&#39;s&amp;nbsp;translation, build, and code review reports help you measure quality and track progress.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Features&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;VB6/COM Compiler-as-a-service:&amp;nbsp;&lt;/strong&gt;configure gmStudio using our extensible rules-scripting language.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Choice of Target Language:&amp;nbsp;&lt;/strong&gt;automatically rewrite VB6/COM in either C# or VB.NET.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Choice of Target IDE:&lt;/strong&gt;&amp;nbsp;choose VS2010 or VS2012 as your Visual Studio IDE.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Choice of Forms Replacement:&lt;/strong&gt;&amp;nbsp;target WinForms or WPF (beta).&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Custom COM/ActiveX Replacement:&lt;/strong&gt;&amp;nbsp;replace COM APIs and controls with .NET classes that meet your standards.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Custom API Replacement:&lt;/strong&gt;&amp;nbsp;replace Win32 API calls with .NET code that meets your standards.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Custom Language Replacement:&lt;/strong&gt;&amp;nbsp;replace VB6 intrinsics with .NET code that meets your standards.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Stub Generation:&lt;/strong&gt;&amp;nbsp;generate stubbed-out .NET classes for your COM dependencies and application code.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Content Templates:&lt;/strong&gt;&amp;nbsp;use custom, dynamic templates for project files, AssemblyInfo files, and many other code structures.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Custom Deployment/Build Processes:&lt;/strong&gt;&amp;nbsp;add your tasks to the deployment/build processes for the translated code.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;High-performance:&lt;/strong&gt;&amp;nbsp;experiment with many variations of your upgrade rules, even if your system is very large.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Additional Resources&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Learn more: &amp;nbsp;&lt;/strong&gt;visit&amp;nbsp; &lt;a href=&quot;https://portal.greatmigrations.com/display/GMG/Great%20Migrations%20Documentation%20Home&quot;&gt;Great Migrations Documentation Home&lt;/a&gt;&amp;nbsp;for white papers, case studies, videos and webcasts.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Try it yourself: &amp;nbsp;&lt;/strong&gt;submit the&amp;nbsp; &lt;a href=&quot;http://www.greatmigrations.com/en/resources/gmstudio-promotion.aspx&quot;&gt;gmStudio Demo&lt;/a&gt;&amp;nbsp;request form to get a free trial version of gmStudio.&lt;/li&gt;&lt;/ul&gt;</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/1735115104034788571/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/great-migrations-studio-gmstudio.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/1735115104034788571'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/1735115104034788571'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/great-migrations-studio-gmstudio.html' title='Great Migrations Studio (gmStudio)'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-8811161218399618422</id><published>2017-03-14T11:37:00.004-07:00</published><updated>2017-03-14T11:37:23.314-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>ArtinSoft’s Visual Basic Upgrade Companion (VBUC)</title><content type='html'>&lt;br /&gt;ArtinSoft’s  Visual Basic Upgrade Companion (VBUC) is the industry-leading tool for  the migration of Visual Basic 6 to both Visual Basic .NET and C#. With a  proven track record of millions of lines of code upgraded to  Microsoft’s .NET Framework, the VBUC helps you move your business  critical applications out of obsolescence, free of ties to third-party  dependencies.&lt;br /&gt;If you are looking towards taking advantage of new  Microsoft technologies, reducing development, deployment and maintenance  costs, and addressing compliance issues or meeting market demands, the  VBUC is the most advanced and cost-effective solution out there.&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;http://www.artinsoft.com/msdn/?msdn&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/en-us/vstudio/ee402630.Download_lg%28en-us,MSDN.10%29.png&quot; style=&quot;margin-right: 5px;&quot; width=&quot;33&quot; /&gt;&lt;/a&gt;&lt;/td&gt;&lt;td align=&quot;center&quot;&gt;&lt;h3 align=&quot;center&quot;&gt;&lt;a href=&quot;http://www.artinsoft.com/msdn/?msdn&quot;&gt;Learn more and download a free version of VBUC&lt;/a&gt;&lt;/h3&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class=&quot;BostonPostCard&quot;&gt;&lt;h3&gt;Exciting Offer for You!&lt;/h3&gt;Microsoft  and ArtinSoft have partnered to offer a free VBUC license to you. The  discount code below can be used to purchase a license that will allow  you to migrate an application of up to 10,000 lines of VB6 code to  VB.NET or C# for free. It can also be applied when purchasing a larger  license.&lt;br /&gt; &lt;a href=&quot;https://www.artinsoft.com/checkout/vbucee-versions.aspx?pc=msdn&quot; target=&quot;_blank&quot;&gt;Download your copy today&lt;/a&gt;. Use the code &lt;strong&gt;MSDN&lt;/strong&gt; for a free license for up to 10,000 lines of code!&lt;/div&gt;&lt;div class=&quot;BostonPostCard&quot;&gt;&lt;h3&gt;Benefits&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;Cost-effectively  convert your application to either C# or VB.NET: About 80% savings  versus a manual rewrite and 60% versus other tools.&lt;/li&gt;&lt;li&gt;Accelerate your VB6 to .NET migration: Lower your project timeframe up to 4 times less than other solutions.&lt;/li&gt;&lt;li&gt;Reduce  project risks: The VBUC is a non-disruptive, highly automated tool that  preserves all the business rules embedded in the code and the value of  the original application.&lt;/li&gt;&lt;li&gt;Take advantage of the new platform  features: Generate 100% native VB.NET or C# code, easy to maintain and  evolve. No ties to proprietary third-party runtimes that deprive you of  all the benefits of the .NET Framework.&lt;/li&gt;&lt;li&gt;Extend and customize the  migration tool based on your needs: Add support for more legacy  components and enhance existing features to comply with enterprise  coding standards.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class=&quot;BostonPostCard&quot;&gt;&lt;h3&gt;Features&lt;/h3&gt;The  Visual Basic Upgrade Companion includes a large set of powerful  features and customization/extensibility options that provide a wide  range of choices for the code conversion process, dramatically reducing  the subsequent amount of required manual work and producing native .NET  code while making the translated application to compile and run with a  behavior that is equivalent to the original VB6 system.&lt;br /&gt;These are some of the unique characteristics of the Visual Basic Upgrade Companion:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Language transformations:&lt;/strong&gt; The VBUC performs the most advanced language transformations to  generate pure, clean and readable .NET source code employing the most of  its inherent features.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Advanced Code Refactoring:&lt;/strong&gt; The VBUC applies additional transformation rules to generate code that looks as if it was originally written in .NET.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Reference Resolution Between Projects:&lt;/strong&gt; Save time, human effort and money by easily upgrading multi-project, complex applications in a single run.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Error Handling Transformation:&lt;/strong&gt; Eliminate the “On error” and “Go to” statements from your resulting .NET code with just a single click.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Resolve Late Bound Variable Types:&lt;/strong&gt; All the data-type issues are automatically fixed during the migration.  Late binding variables will no longer have generic data types.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Extensibility:&lt;/strong&gt; Appropriate code conversion rules and component mappings can be set  through switchable options that are displayed in a Profile Manager  window. All the particular code techniques and patterns found in your  code can be described into the VBUC’s core, including the ability to add  or fine-tune existing support for ActiveX controls and libraries. More  complex customizations can be implemented by ArtinSoft on user request.&lt;/li&gt;&lt;/ul&gt;&lt;div align=&quot;left&quot;&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/vstudio/ff793478.vbucscreenshot1%28l=en-us%29.png&quot; target=&quot;_blank&quot;&gt;&lt;img align=&quot;&quot; alt=&quot;Click for larger image&quot; src=&quot;https://i-msdn.sec.s-msft.com/en-us/vstudio/ff793478.VBUCScreenShot1_thumb%28en-us,MSDN.10%29.png&quot; title=&quot;Click for larger image&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;align: left;&quot;&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Third Party Library Support:&lt;/strong&gt; The Visual Basic Upgrade Companion is able to upgrade many ActiveX  controls found in the original application to inherent .NET components  or to newer versions of those third-party controls.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Legacy Data Access to ADO.NET:&lt;/strong&gt; Upgrade your data access (ADO, DAO, RDO) to ADO.NET automatically with several source-target combination possibilities.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;ASP/VB6 Migration Support:&lt;/strong&gt; The VBUC allows the migration of mixed ASP and VB6 projects to ASP.NET and VB.NET or C#.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;User Environment:&lt;/strong&gt; Advanced GUI and Command Line interface oriented to improve its  usability and user experience. The UI and all messages, including EWIs,  can be displayed in different languages, besides the standard English.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/vstudio/ff793478.vbucscreenshot2%28l=en-us%29.png&quot; target=&quot;_blank&quot;&gt;&lt;img align=&quot;&quot; alt=&quot;Click for larger image&quot; src=&quot;https://i-msdn.sec.s-msft.com/en-us/vstudio/ff793478.VBUCScreenShot2_thumb%28en-us,MSDN.10%29.png&quot; title=&quot;Click for larger image&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style=&quot;align: left;&quot;&gt;For an updated, more detailed features list please visit the VBUC’s technical site:  &lt;a href=&quot;http://www.vbtonet.com/?msdn&quot;&gt;http://www.vbtonet.com/?msdn&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;BostonPostCard&quot;&gt;&lt;h3&gt;Learn More and Try it for Yourself&lt;/h3&gt;Learn more about the VBUC, read customer evidence, access white papers, videos and webcasts, or download a free trial at:  &lt;a href=&quot;https://www.artinsoft.com/msdn/?msdn&quot;&gt;https://www.artinsoft.com/msdn&lt;/a&gt;.&lt;/div&gt;&lt;div class=&quot;BostonPostCard&quot;&gt;&lt;h3&gt;Additional Resources&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://www.artinsoft.com/visual-basic-upgrade-assessment-tool.aspx?msdn&quot;&gt;VB/ASP Assessment Tool&lt;/a&gt;: a free product that works as a measuring  instrument for the upgrade effort, analyzing the application components  and the relationships between them from a migration perspective, which  considers elements, constructs, and features that consume significant  resources during an upgrade project.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.artinsoft.com/vb-migration-overview.aspx?msdn&quot;&gt;VB migration services&lt;/a&gt;: ArtinSoft can also provide consulting  services that range from technical support on an hourly basis to a  complete turn-key solution, accelerating and simplifying the migration  process of your Visual Basic 6 applications, either to the .NET Platform  or straight to the Web, significantly reducing costs, time, and risks.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.vbtonet.com/?msdn&quot;&gt;VBUC technical site:&lt;/a&gt; a comprehensive website around the Visual basic  Upgrade Companion, full of documentation and other resources to help  you achieve success on your VB6 to .NET migration projects.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.artinsoft.com/ab_customers.aspx?msdn&quot;&gt;ArtinSoft’s customers&lt;/a&gt;: a partial list of companies who have benefitted from using our unique migration technology.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.artinsoft.com/cs_home.aspx?msdn&quot;&gt;ArtinSoft’s case studies and testimonials&lt;/a&gt;: detailed customer evidence ranging from quotes to comprehensive success stories.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.artinsoft.com/whitepapers.aspx?msdn&quot;&gt;ArtinSoft’s white papers&lt;/a&gt;: loads of useful information to plan your migration project accordingly and succeed.&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://www.artinsoft.com/artinsoft-video-and-audio-files.aspx?msdn&quot;&gt;ArtinSoft’s multimedia resources&lt;/a&gt;: training /demo videos, webcasts, podcasts and more.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/8811161218399618422/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/artinsofts-visual-basic-upgrade.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/8811161218399618422'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/8811161218399618422'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/artinsofts-visual-basic-upgrade.html' title='ArtinSoft’s Visual Basic Upgrade Companion (VBUC)'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-8961532430321191762</id><published>2017-03-14T11:34:00.002-07:00</published><updated>2017-03-14T11:34:27.819-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Access the File System with .NET Framework Classes from Visual Basic 6</title><content type='html'>&lt;div class=&quot;lw_vs&quot;&gt;    &lt;div id=&quot;curversion&quot;&gt;      &lt;strong&gt;                Visual Studio 2005             &lt;/strong&gt;    &lt;/div&gt;&lt;/div&gt;&amp;nbsp; &lt;a href=&quot;mailto:scott@swigartconsulting.com&quot;&gt;Scott Swigart&lt;/a&gt;&lt;br /&gt;Swigart Consulting LLC.&lt;br /&gt;  Applies to:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft Visual Basic 6&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft Visual Basic 2005&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft Visual Basic .NET 2003&lt;br /&gt;  &lt;strong&gt;Summary:&lt;/strong&gt; Accessing the file system is a common  application requirement, and in the spirit of Microsoft Visual Basic  Fusion, this article shows how to access some of the best Microsoft .NET  Framework file system functionality from existing Visual Basic 6  applications. Learn how to get the extension for a file, the directory  portion or a path, or the file name portion of a path. Learn how to fire  events every time the contents of a directory change. (16 printed  pages)&lt;br /&gt;  &lt;a href=&quot;http://download.microsoft.com/download/7/f/9/7f9a0b17-6abb-48ac-a16d-3f177e985c78/VisualBasicFusion-IO_IO.msi&quot;&gt;Download&lt;/a&gt; the Visual Basic Fusion—IO_IO.msi code sample for this article.&lt;br /&gt;   &lt;h4 class=&quot;dtH1&quot;&gt;Contents&lt;/h4&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/ms364070.aspx#vbfusionio_topic1&quot;&gt;Introduction&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/ms364070.aspx#vbfusionio_topic2&quot;&gt;Primer: Calling .NET from Visual Basic 6&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/ms364070.aspx#vbfusionio_topic3&quot;&gt;Using the Path Class from Visual Basic 6&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/ms364070.aspx#vbfusionio_topic4&quot;&gt;Using the FolderBrowserDialog from Visual Basic 6&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/ms364070.aspx#vbfusionio_topic5&quot;&gt;Using the FileSystemWatcher from Visual Basic 6&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/ms364070.aspx#vbfusionio_topic6&quot;&gt;Examining the Construction of IOLib&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/ms364070.aspx#vbfusionio_topic7&quot;&gt;Conclusion&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/ms364070.aspx#vbfusionio_topic8&quot;&gt;Additional Resources&lt;/a&gt;&lt;br /&gt;  &lt;h2 class=&quot;dtH1&quot;&gt;Introduction&lt;/h2&gt;Accessing the file system is a common application requirement, and in  the sprit of Visual Basic Fusion, this article will show you how you  can access some of the best .NET Framework file system functionality  from existing Visual Basic 6 applications.&lt;br /&gt;  First, there&#39;s the &lt;strong&gt;Path&lt;/strong&gt; class. This class makes it a  snap to work with, and extract pieces of file system path strings. With  one line of code, you can get the extension for a file, or get the  directory portion of a path, or get the file name portion of a path. You  can even switch a file extension, or determine if a path is relative or  absolute.&lt;br /&gt;  Next, there&#39;s the &lt;strong&gt;FolderBrowserDialog&lt;/strong&gt; class, which makes it easy to display a dialog box that lets the user pick a folder path.&lt;br /&gt;  &lt;div class=&quot;fig&quot;&gt;&lt;img alt=&quot;ms364070.vbfusion01(en-US,VS.80).gif&quot; id=&quot;vbfusion01&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC39268.gif&quot; title=&quot;ms364070.vbfusion01(en-US,VS.80).gif&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 1. Folder Browser dialog box&lt;/strong&gt;&lt;/div&gt;Displaying this system dialog box from Visual Basic 6 requires a good  amount of Win32 API calls. However, by using the IOLib included with  this article (written in Visual Basic 2005), you can easily display this  dialog box from a Visual Basic 6 application.&lt;br /&gt;  Finally, this article will examine the &lt;strong&gt;FileSystemWatcher&lt;/strong&gt; class. This class can fire events every time the contents of a  directory change. So if you have an application that needs to process  new files as they appear or change, this is a great class to use. And  again, it can be used easily from Visual Basic 6.&lt;br /&gt;  &lt;h2 class=&quot;dtH1&quot;&gt;Primer: Calling .NET from Visual Basic 6&lt;/h2&gt;In general, you cannot call classes from Visual Basic 6 directly into  the .NET Framework because the .NET Framework classes do not expose  themselves as COM objects. However, you can use Visual Basic 2005 to  create COM wrappers for the portions of the .NET Framework that you want  to use. Your Visual Basic 6 code calls into your COM wrapper, and the  COM wrapper calls into the .NET framework.&lt;br /&gt;  &lt;div class=&quot;fig&quot;&gt;&lt;img alt=&quot;ms364070.vbfusion02(en-US,VS.80).gif&quot; id=&quot;vbfusion02&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC120414.gif&quot; title=&quot;ms364070.vbfusion02(en-US,VS.80).gif&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 2. Calling into the .NET Framework with wrapper classes&lt;/strong&gt;&lt;/div&gt;This is the approach used in this article. The sample code for this  article includes a Visual Basic 2005 project called IOLib that is a  wrapper for the .NET Framework Path class, &lt;strong&gt;FolderBrowserDialog&lt;/strong&gt; class, and &lt;strong&gt;FileSystemWatcher&lt;/strong&gt; class. This article will initially show how you can use IOLib from your  Visual Basic 6 applications. If you&#39;re interested in how IOLib was  constructed, the article will finish off with a walkthrough on building  your own wrapper classes.&lt;br /&gt;  &lt;h2 class=&quot;dtH1&quot;&gt;Using the Path Class from Visual Basic 6&lt;/h2&gt;Sometimes, an application needs to manipulate a file path string. For  example, you might have a full path to a file, but you want to just get  the directory portion of the path. Other times, you may want just the  file name, without the directory information. Other times, you may want  to examine the file extension so that you can take different action for  different file types. You may even want to change the extension for a  file if you are loading it from one format and saving it with a  different one.  &lt;br /&gt;  The &lt;strong&gt;Path&lt;/strong&gt; class exists to make these kinds of  operations very simple. The IOLib included with this article wraps the  .NET Path class so that you can call it from Visual Basic 6 or other COM  based environments. Through this COM wrapper, you can access the  following functionality:&lt;br /&gt;  &lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Table 1. COM wrapper functionality&lt;/strong&gt;&lt;/div&gt;&lt;div class=&quot;tablediv&quot;&gt;&lt;div class=&quot;contentTableWrapper&quot;&gt;&lt;table class=&quot;dtTABLE&quot; summary=&quot;table&quot;&gt; &lt;tbody&gt;&lt;tr&gt;&lt;th scope=&quot;col&quot;&gt;Property or Method&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-th=&quot;Property or Method&quot;&gt;&lt;strong&gt;ChangeExtension&lt;/strong&gt;&lt;/td&gt;&lt;td data-th=&quot;Description&quot;&gt;Changes the extension of a path string.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-th=&quot;Property or Method&quot;&gt;&lt;strong&gt;Combine&lt;/strong&gt;&lt;/td&gt;&lt;td data-th=&quot;Description&quot;&gt;Combines two path strings.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-th=&quot;Property or Method&quot;&gt;&lt;strong&gt;GetDirectoryName&lt;/strong&gt;&lt;/td&gt;&lt;td data-th=&quot;Description&quot;&gt;Returns the directory information for the specified path string.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-th=&quot;Property or Method&quot;&gt;&lt;strong&gt;GetExtension&lt;/strong&gt;&lt;/td&gt;&lt;td data-th=&quot;Description&quot;&gt;Returns the extension of the specified path string.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-th=&quot;Property or Method&quot;&gt;&lt;strong&gt;GetFileName&lt;/strong&gt;&lt;/td&gt;&lt;td data-th=&quot;Description&quot;&gt;Returns the file name and extension of the specified path string.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-th=&quot;Property or Method&quot;&gt;&lt;strong&gt;GetFullPath&lt;/strong&gt;&lt;/td&gt;&lt;td data-th=&quot;Description&quot;&gt;Returns the absolute path for the specified path string.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-th=&quot;Property or Method&quot;&gt;&lt;strong&gt;GetPathRoot&lt;/strong&gt;&lt;/td&gt;&lt;td data-th=&quot;Description&quot;&gt;Gets the root directory information of the specified path.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-th=&quot;Property or Method&quot;&gt;&lt;strong&gt;GetTempFileName&lt;/strong&gt;&lt;/td&gt;&lt;td data-th=&quot;Description&quot;&gt;Returns a uniquely named zero-byte temporary file on disk and returns the full path to that file.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-th=&quot;Property or Method&quot;&gt;&lt;strong&gt;GetTempPath&lt;/strong&gt;&lt;/td&gt;&lt;td data-th=&quot;Description&quot;&gt;Returns the path of the current system&#39;s temporary folder.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-th=&quot;Property or Method&quot;&gt;&lt;strong&gt;HasExtension&lt;/strong&gt;&lt;/td&gt;&lt;td data-th=&quot;Description&quot;&gt;Determines whether a path includes a file name extension.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-th=&quot;Property or Method&quot;&gt;&lt;strong&gt;IsPathRooted&lt;/strong&gt;&lt;/td&gt;&lt;td data-th=&quot;Description&quot;&gt;Gets a value indicating whether the specified path string contains absolute or relative path information.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-th=&quot;Property or Method&quot;&gt;&lt;strong&gt;InvalidPathChars&lt;/strong&gt;&lt;/td&gt;&lt;td data-th=&quot;Description&quot;&gt;Provides a platform-specific array of characters that cannot be specified in path string arguments passed to members of the &lt;strong&gt;Path&lt;/strong&gt; class.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;The following walkthrough will illustrate using &lt;strong&gt;Path&lt;/strong&gt; class from Visual Basic 6.&lt;br /&gt;  Prior to completing this walkthrough, you must install Visual Studio 2005, Visual Basic Express. Visual Basic Express is a &lt;a href=&quot;https://msdn.microsoft.com/vstudio/express/vb/default.aspx&quot;&gt;free and relatively small download&lt;/a&gt;,  and can install along side of Visual Studio 6.0, Visual Studio .NET,  Visual Studio 2003, or Visual Studio 2005, without any problems.&lt;br /&gt;  &lt;strong&gt;Walkthrough: Using the Path class from Visual Basic&lt;/strong&gt; &lt;strong&gt;6&lt;/strong&gt; &lt;br /&gt;&lt;ol&gt;&lt;li&gt;If you have not already run the install for the sample code, in the sample code folder for this article, navigate into the &lt;strong&gt;Code&lt;/strong&gt; sub-folder, and double-click &lt;strong&gt;install.bat&lt;/strong&gt;.  This registers the .NET framework DLLs, and the IOLib wrapper so that it can be used from Visual Basic 6.0 &lt;/li&gt;&lt;li&gt;Start &lt;strong&gt;Visual Basic 6.0&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;New Project&lt;/strong&gt; dialog box, select &lt;strong&gt;Standard EXE&lt;/strong&gt;, and click &lt;strong&gt;Open&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Right-click on the &lt;strong&gt;Toolbox&lt;/strong&gt;, and select &lt;strong&gt;Components...&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;Components&lt;/strong&gt; dialog box, check &lt;strong&gt;Microsoft Common Dialog Control 6.0&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Select the &lt;strong&gt;Project | References &lt;/strong&gt;menu command.&lt;/li&gt;&lt;li&gt;Check &lt;strong&gt;IOLib&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt;. You have now referenced the .NET DLLs needed to display the folder  browser dialog box from Visual Basic 6. It&#39;s now time to build the user  interface. &lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;Toolbox&lt;/strong&gt;, double-click the &lt;strong&gt;CommonDialog&lt;/strong&gt; control to add it to the form.&lt;/li&gt;&lt;li&gt;Add a &lt;strong&gt;TextBox&lt;/strong&gt; to the form, and resize it so that it fills most of the form.&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;Properties&lt;/strong&gt; window, for the &lt;strong&gt;Text1&lt;/strong&gt; control, set the following properties: &lt;ol&gt;&lt;li&gt;Multiline = True&lt;/li&gt;&lt;li&gt;Text = (an empty string) This text box will display information about a selected file using the &lt;strong&gt;Path&lt;/strong&gt; class. &lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;Right-click on the &lt;strong&gt;Form&lt;/strong&gt;, and select &lt;strong&gt;View Code&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Enter the following code: &lt;pre class=&quot;code&quot;&gt;Private Sub Form_Load()&lt;br /&gt;Dim path As New IOLib.PathWrapper&lt;br /&gt;With CommonDialog1&lt;br /&gt;    .ShowOpen&lt;br /&gt;    If .FileName &amp;lt;&amp;gt; &quot;&quot; Then&lt;br /&gt;        Text1 = &quot;Directory: &quot; &amp;amp; path.GetDirectoryName(.FileName) &amp;amp; _&lt;br /&gt;            vbCrLf&lt;br /&gt;        Text1 = Text1 &amp;amp; &quot;Has extension: &quot; &amp;amp; _&lt;br /&gt;            path.HasExtension(.FileName) &amp;amp; vbCrLf&lt;br /&gt;        Text1 = Text1 &amp;amp; &quot;Extension: &quot; &amp;amp; _&lt;br /&gt;            path.GetExtension(.FileName) &amp;amp; vbCrLf&lt;br /&gt;        Text1 = Text1 &amp;amp; &quot;FileName: &quot; &amp;amp; _&lt;br /&gt;            path.GetFileName(.FileName) &amp;amp; vbCrLf&lt;br /&gt;        Text1 = Text1 &amp;amp; &quot;Root: &quot; &amp;amp; _&lt;br /&gt;            path.GetPathRoot(.FileName) &amp;amp; vbCrLf&lt;br /&gt;        Text1 = Text1 &amp;amp; &quot;Absolute or Relative: &quot; &amp;amp; _&lt;br /&gt;            IIf(path.IsPathRooted(.FileName), &quot;Absolute&quot;, &quot;Relative&quot;)&lt;br /&gt;    End If&lt;br /&gt;End With&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Press &lt;strong&gt;F5&lt;/strong&gt; to run the application&lt;/li&gt;&lt;/ol&gt;As you can see, when you select a file, this application shows you a number of things about that file path.&lt;br /&gt;  &lt;div class=&quot;fig&quot;&gt;&lt;img alt=&quot;ms364070.vbfusion03(en-US,VS.80).gif&quot; id=&quot;vbfusion03&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC53062.gif&quot; title=&quot;ms364070.vbfusion03(en-US,VS.80).gif&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 3. Using the Path class from Visual Basic 6&lt;/strong&gt;&lt;/div&gt;With just a line of code, the application can separate the file name  from the directory path. The application can also determine if the file  has an extension, and what the extension is. Finally, the application  can tell you the root folder for the path, and whether the path is  relative or absolute. With Visual Basic 6, you are often required to do  your own string splitting logic to get these pieces of information, and  it&#39;s easy to introduce bugs if the user provides UNC paths, or other  path formats that your application may not expect. Not only is the &lt;strong&gt;Path &lt;/strong&gt;class easier than writing your own logic, but it&#39;s also been tested against a wide range of paths.&lt;br /&gt;  &lt;h2 class=&quot;dtH1&quot;&gt;Using the FolderBrowserDialog from Visual Basic 6&lt;/h2&gt;The folder browser dialog box is very useful when you need the user  to select a folder (rather than a specific file). The operating system  includes a built-in folder browser dialog box, but Visual Basic 6 does  not provide access to this dialog box. If you want to display the folder  browser with Visual Basic 6, you need to call the &lt;strong&gt;SHBrowseForFolder&lt;/strong&gt; and other Win32 API functions.&lt;br /&gt;  However, the .NET Framework does contain a &lt;strong&gt;FolderBrowserDialog&lt;/strong&gt; class, and the IOLib code included with this article wraps the &lt;strong&gt;FolderBrowserDialog&lt;/strong&gt; class so that it can easily be used from Visual Basic 6. The IOLib &lt;strong&gt;FolderBrowserDialogWrapper&lt;/strong&gt; exposes the following functionality:&lt;br /&gt;  &lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Table 2. FolderBrowserDialogWrapper functionality&lt;/strong&gt;&lt;/div&gt;&lt;div class=&quot;tablediv&quot;&gt;&lt;div class=&quot;contentTableWrapper&quot;&gt;&lt;table class=&quot;dtTABLE&quot; summary=&quot;table&quot;&gt; &lt;tbody&gt;&lt;tr&gt;&lt;th scope=&quot;col&quot;&gt;Property or Method&lt;/th&gt;&lt;th scope=&quot;col&quot;&gt;Description&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-th=&quot;Property or Method&quot;&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;&lt;td data-th=&quot;Description&quot;&gt;Gets or sets the descriptive text displayed above the tree view control in the dialog box.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-th=&quot;Property or Method&quot;&gt;&lt;strong&gt;Reset&lt;/strong&gt;&lt;/td&gt;&lt;td data-th=&quot;Description&quot;&gt;Resets properties to their default values.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-th=&quot;Property or Method&quot;&gt;&lt;strong&gt;RootFolder&lt;/strong&gt;&lt;/td&gt;&lt;td data-th=&quot;Description&quot;&gt;Gets or sets the root folder where the browsing starts from.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-th=&quot;Property or Method&quot;&gt;&lt;strong&gt;SelectedPath&lt;/strong&gt;&lt;/td&gt;&lt;td data-th=&quot;Description&quot;&gt;Gets or sets the path selected by the user.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-th=&quot;Property or Method&quot;&gt;&lt;strong&gt;ShowDialog&lt;/strong&gt;&lt;/td&gt;&lt;td data-th=&quot;Description&quot;&gt;Displays the folder browser dialog box.&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td data-th=&quot;Property or Method&quot;&gt;&lt;strong&gt;ShowNewFolderButton&lt;/strong&gt;&lt;/td&gt;&lt;td data-th=&quot;Description&quot;&gt;Gets or sets a value indicating whether the New Folder button appears in the folder browser dialog box.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;The following steps illustrate using the &lt;strong&gt;FolderBrowserDialog&lt;/strong&gt; class from Visual Basic 6:&lt;br /&gt;  &lt;strong&gt;Walkthrough: Using the .NET FolderBrowserDialog from Visual Basic&lt;/strong&gt; &lt;strong&gt;6&lt;/strong&gt; &lt;br /&gt;&lt;ol&gt;&lt;li&gt;If you have not already run the install for the sample code, in the sample code folder for this article, navigate into the &lt;strong&gt;Code&lt;/strong&gt; sub-folder, and double-click &lt;strong&gt;install.bat&lt;/strong&gt;.   This registers the .NET framework DLLs, and the IOLib wrapper class so that it can be used from Visual Basic 6.0. &lt;/li&gt;&lt;li&gt;Start &lt;strong&gt;Visual Basic 6.0&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;New Project&lt;/strong&gt; dialog, select &lt;strong&gt;Standard EXE&lt;/strong&gt;, and click &lt;strong&gt;Open&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Select the &lt;strong&gt;Project | References&lt;/strong&gt; menu command.&lt;/li&gt;&lt;li&gt;Check &lt;strong&gt;IOLib&lt;/strong&gt;, and &lt;strong&gt;System.Windows.Forms.DLL&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt;. You have now referenced the .NET DLLs needed to display the folder  browser dialog box from Visual Basic 6. It&#39;s time to write some code. &lt;/li&gt;&lt;li&gt;Double-click &lt;strong&gt;Form1&lt;/strong&gt; in the designer to cause Visual Basic to generate the &lt;strong&gt;Form_Load&lt;/strong&gt; subroutine and switch you to the code editor.&lt;/li&gt;&lt;li&gt;Inside of &lt;strong&gt;Form_Load&lt;/strong&gt;, enter the following code: &lt;pre class=&quot;code&quot;&gt;Dim fb As New IOLib.FolderBrowserDialogWrapper&lt;br /&gt;fb.Description = &quot;Select a folder&quot;&lt;br /&gt;fb.ShowNewFolderButton = True&lt;br /&gt;fb.RootFolder = SpecialFolderWrapper_ProgramFiles&lt;br /&gt;If fb.ShowDialog = DialogResult_OK Then&lt;br /&gt;    MsgBox fb.SelectedPath&lt;br /&gt;End If&lt;br /&gt;&lt;/pre&gt;This creates an instance of the box class. This wrapper is then used  to configure properties such as the description text and starting  folder. The folder browser is also configured to allow the user to  create a new folder through the dialog box. Finally, the dialog box is  shown, and if the user clicks the &lt;strong&gt;OK&lt;/strong&gt; button, the path selected in the dialog box is processed. &lt;/li&gt;&lt;li&gt;Press &lt;strong&gt;F5&lt;/strong&gt; to run the application. The following dialog box should appear: &lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;ms364070.vbfusion04(en-US,VS.80).gif&quot; id=&quot;vbfusion04&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC124754.gif&quot; title=&quot;ms364070.vbfusion04(en-US,VS.80).gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 4. Displaying the folder browser dialog box from Visual Basic 6&lt;/strong&gt; &lt;/div&gt;When a folder is selected, you should see the path to the folder appear in the message box.  &lt;br /&gt;&lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;ms364070.vbfusion05(en-US,VS.80).gif&quot; id=&quot;vbfusion05&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC141300.gif&quot; title=&quot;ms364070.vbfusion05(en-US,VS.80).gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 5. Displaying the folder selected by the user&lt;/strong&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;You can see that displaying the folder browser dialog box from Visual  Basic 6 using the .NET Framework is much easier than displaying it  using Win32 API calls.&lt;br /&gt;  &lt;h2 class=&quot;dtH1&quot;&gt;Using the FileSystemWatcher from Visual Basic 6&lt;/h2&gt;I&#39;ve probably saved the best for last. The Microsoft .NET Framework includes a class called the &lt;strong&gt;FileSystemWatcher&lt;/strong&gt;, which will raise an event any time files in a folder are created, deleted, changed, or renamed. Normally, you can&#39;t use the &lt;strong&gt;FileSystemWatcher&lt;/strong&gt; directly from Visual Basic 6, but IOLib (supplied with this article) wraps the &lt;strong&gt;FileSystemWatcher&lt;/strong&gt;, making it simple to use from COM environments.&lt;br /&gt;  The following walkthrough will show you how to use the &lt;strong&gt;FileSystemWatcher&lt;/strong&gt; to detect changes under a directory.&lt;br /&gt;  &lt;strong&gt;Walkthrough: Using the FileSystemWatcher from Visual Basic&lt;/strong&gt; &lt;strong&gt;6&lt;/strong&gt; &lt;br /&gt;&lt;ol&gt;&lt;li&gt;If you have not already run the install for the sample code, in the sample code folder for this article, navigate into the &lt;strong&gt;Code&lt;/strong&gt; sub-folder, and double-click &lt;strong&gt;install.bat&lt;/strong&gt;.   This registers the .NET framework DLLs, and the IOLib wrapper class so that it can be used from Visual Basic 6.0 &lt;/li&gt;&lt;li&gt;Create a new folder on your hard disk called &lt;strong&gt;C:\WatchedFolder&lt;/strong&gt;. This folder will be monitored by the &lt;strong&gt;FileSystemWatcher&lt;/strong&gt; for changes.&lt;/li&gt;&lt;li&gt;Start &lt;strong&gt;Visual Basic 6.0&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;New Project&lt;/strong&gt; dialog box, select &lt;strong&gt;Standard EXE&lt;/strong&gt;, and click &lt;strong&gt;Open&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Select the &lt;strong&gt;Project | References &lt;/strong&gt;menu command.&lt;/li&gt;&lt;li&gt;Check &lt;strong&gt;IOLib&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt;. You have now referenced the .NET DLLs needed to use the &lt;strong&gt;FileSystemWatcher&lt;/strong&gt; class from Visual Basic 6.  &lt;/li&gt;&lt;li&gt;Add a &lt;strong&gt;CommandButton&lt;/strong&gt; and &lt;strong&gt;TextBox &lt;/strong&gt;to the form.&lt;/li&gt;&lt;li&gt;For the &lt;strong&gt;CommandButton&lt;/strong&gt;, set the text property to &lt;strong&gt;Start Watching&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;For the &lt;strong&gt;TextBox&lt;/strong&gt;: &lt;ol&gt;&lt;li&gt;Set the &lt;strong&gt;Text &lt;/strong&gt;property to &lt;strong&gt;blank&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Set the &lt;strong&gt;MultiLine&lt;/strong&gt; property to &lt;strong&gt;True&lt;/strong&gt;.&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;Double-click the &lt;strong&gt;Form&lt;/strong&gt; to have Visual Basic generate the &lt;strong&gt;Form_Load&lt;/strong&gt; event handler, and switch you into Code view.&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;General Declarations&lt;/strong&gt; section (above &lt;strong&gt;Form_Load&lt;/strong&gt;), enter the following: &lt;pre class=&quot;code&quot;&gt;Private WithEvents fsw As IOLib.FileSystemWatcherWrapper&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;Form_Load&lt;/strong&gt; event, enter the following: &lt;pre class=&quot;code&quot;&gt;Set fsw = New IOLib.FileSystemWatcherWrapper&lt;br /&gt;&lt;/pre&gt;At this point, you have created an instance of the class that will be used to monitor the C:\WatchedFolder for any changes. &lt;/li&gt;&lt;li&gt;From the &lt;strong&gt;Object drop-down&lt;/strong&gt;, select &lt;strong&gt;Command1&lt;/strong&gt;. &lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;ms364070.vbfusion06(en-US,VS.80).gif&quot; id=&quot;vbfusion06&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC107072.gif&quot; title=&quot;ms364070.vbfusion06(en-US,VS.80).gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 6. Selecting the command button with the Object drop-down&lt;/strong&gt; &lt;/div&gt;This will generate the click event for the &lt;strong&gt;CommandButton&lt;/strong&gt; control. &lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;Command1_Click&lt;/strong&gt; event, enter the following code: &lt;pre class=&quot;code&quot;&gt;fsw.InitWatcher (&quot;C:\WatchedFolder&quot;)&lt;br /&gt;fsw.IncludeSubDirectories = True&lt;br /&gt;fsw.EnableRaisingEvents = True&lt;br /&gt;&lt;/pre&gt;This tells the &lt;strong&gt;FileSystemWatcher&lt;/strong&gt; which folder it  should monitor. It also indicates that any sub-directories of that  folder should also be watched. Finally, it tells the &lt;strong&gt;FileSystemWatcher&lt;/strong&gt; to begin raising events as soon as anything changes.  &lt;br /&gt;The only remaining task is wiring up event handlers to process any changes. &lt;/li&gt;&lt;li&gt;From the &lt;strong&gt;Object drop-down&lt;/strong&gt;, select &lt;strong&gt;fsw&lt;/strong&gt;. This generates the &lt;strong&gt;fsw_Changed&lt;/strong&gt; event handler, which will fire any time a file under the C:\WatchedFolder directory changes. &lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;fsw_Changed&lt;/strong&gt; event handler, enter the following code: &lt;pre class=&quot;code&quot;&gt;Text1 = Text1 &amp;amp; &quot;Changed: &quot; &amp;amp; e.FullPath &amp;amp; vbCrLf&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;Procedure&lt;/strong&gt; drop-down, select &lt;strong&gt;Created&lt;/strong&gt;. &lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;ms364070.vbfusion07(en-US,VS.80).gif&quot; id=&quot;vbfusion07&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC3149.gif&quot; title=&quot;ms364070.vbfusion07(en-US,VS.80).gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 7. Selecting the Created event with the procedure drop down&lt;/strong&gt; &lt;/div&gt;This will generate the &lt;strong&gt;fsw_Created&lt;/strong&gt; event handler. This event fires whenever a new file appears under the C:\WatchedFolder directory. &lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;fsw_Created&lt;/strong&gt; event handler, enter the following code: &lt;pre class=&quot;code&quot;&gt;Text1 = Text1 &amp;amp; &quot;Created: &quot; &amp;amp; e.FullPath &amp;amp; vbCrLf&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Repeat steps &lt;strong&gt;18&lt;/strong&gt; and &lt;strong&gt;19&lt;/strong&gt; to create event handlers for the &lt;strong&gt;Deleted&lt;/strong&gt; and &lt;strong&gt;Renamed&lt;/strong&gt; events. Your final code should appear as: &lt;pre class=&quot;code&quot;&gt;Private WithEvents fsw As IOLib.FileSystemWatcherWrapper&lt;br /&gt;Private Sub Command1_Click()&lt;br /&gt;    fsw.InitWatcher (&quot;C:\WatchedFolder&quot;)&lt;br /&gt;    fsw.IncludeSubDirectories = True&lt;br /&gt;    fsw.EnableRaisingEvents = True&lt;br /&gt;End Sub&lt;br /&gt;Private Sub Form_Load()&lt;br /&gt;    Set fsw = New IOLib.FileSystemWatcherWrapper&lt;br /&gt;End Sub&lt;br /&gt;Private Sub fsw_Changed(ByVal e As IOLib.FileSystemEventArgsWrapper)&lt;br /&gt;    Text1 = Text1 &amp;amp; &quot;Changed: &quot; &amp;amp; e.FullPath &amp;amp; vbCrLf&lt;br /&gt;End Sub&lt;br /&gt;Private Sub fsw_Created(ByVal e As IOLib.FileSystemEventArgsWrapper)&lt;br /&gt;    Text1 = Text1 &amp;amp; &quot;Created: &quot; &amp;amp; e.FullPath &amp;amp; vbCrLf&lt;br /&gt;End Sub&lt;br /&gt;Private Sub fsw_Deleted(ByVal e As IOLib.FileSystemEventArgsWrapper)&lt;br /&gt;    Text1 = Text1 &amp;amp; &quot;Deleted: &quot; &amp;amp; e.FullPath &amp;amp; vbCrLf&lt;br /&gt;End Sub&lt;br /&gt;Private Sub fsw_Renamed(ByVal e As IOLib.FileSystemEventArgsWrapper)&lt;br /&gt;    Text1 = Text1 &amp;amp; &quot;Renamed: &quot; &amp;amp; e.FullPath &amp;amp; vbCrLf&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Press &lt;strong&gt;F5&lt;/strong&gt; to run the application.&lt;/li&gt;&lt;li&gt;Click &lt;strong&gt;Start Watching&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Open &lt;strong&gt;Windows Explorer&lt;/strong&gt; and navigate to the &lt;strong&gt;C:\WatchedFolder&lt;/strong&gt; directory.&lt;/li&gt;&lt;li&gt;Select the &lt;strong&gt;File | New | Text document&lt;/strong&gt; menu command. This creates a new file in the folder, and should trigger an event in your application. &lt;/li&gt;&lt;li&gt;Rename the new file to &lt;strong&gt;test.txt&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Delete &lt;strong&gt;test.txt&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Switch to your application. It should appear as follows: &lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;ms364070.vbfusion08(en-US,VS.80).gif&quot; id=&quot;vbfusion08&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC64478.gif&quot; title=&quot;ms364070.vbfusion08(en-US,VS.80).gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 8. Output from the Visual Basic 6 application using the FileSystemWatcher&lt;/strong&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;You can see that the application was able to monitor the directory  for any changes, and the changes are displayed in the text box. Often  this is used for batch processing of files as they are uploaded,  exported from a mainframe, or are otherwise placed into a &quot;drop&quot; folder.&lt;br /&gt;  &lt;h2 class=&quot;dtH1&quot;&gt;Examining the Construction of IOLib&lt;/h2&gt;In the code download provided with this article you will find a  folder called IOLib. Double-clicking the IOLib.sln file in that folder  will open the solution in Visual Studio 2005 or Visual Basic Express.&lt;br /&gt;  When the solution opens, you will be able to see the various wrapper classes listed in the Solution Explorer.&lt;br /&gt;  &lt;div class=&quot;fig&quot;&gt;&lt;img alt=&quot;ms364070.vbfusion09(en-US,VS.80).gif&quot; id=&quot;vbfusion09&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC100816.gif&quot; title=&quot;ms364070.vbfusion09(en-US,VS.80).gif&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 9. Wrapper classes listed in the Solution Explorer&lt;/strong&gt;&lt;/div&gt;Double-clicking on any of these wrapper classes will open the file in  the code editor. If, for example, you double-click the  FolderBrowserDialogWrapper.vb file, you will see the following code:&lt;br /&gt;  &lt;pre class=&quot;code&quot;&gt;Imports System.Windows.Forms&lt;br /&gt;&amp;lt;ComClass(FolderBrowserDialogWrapper.ClassId, FolderBrowserDialogWrapper.InterfaceId, FolderBrowserDialogWrapper.EventsId)&amp;gt; _&lt;br /&gt;Public Class FolderBrowserDialogWrapper&lt;br /&gt;#Region &quot;COM GUIDs&quot;&lt;br /&gt;    Public Const ClassId As String = &quot;705DDB3F-3A03-4C97-ACE4-9D6F4A50F0AC&quot;&lt;br /&gt;    Public Const InterfaceId As String = &quot;CB311CDB-B62A-444E-B415-A253EB579541&quot;&lt;br /&gt;    Public Const EventsId As String = &quot;E6B1B7BF-F65B-4A56-9534-5C39332332FB&quot;&lt;br /&gt;#End Region&lt;br /&gt;    Private _folderBrowser As FolderBrowserDialog&lt;br /&gt;    Public Sub New()&lt;br /&gt;        MyBase.New()&lt;br /&gt;        _folderBrowser = New FolderBrowserDialog&lt;br /&gt;    End Sub&lt;br /&gt;    Public Property Description() As String&lt;br /&gt;        Get&lt;br /&gt;            Return _folderBrowser.Description&lt;br /&gt;        End Get&lt;br /&gt;        Set(ByVal Value As String)&lt;br /&gt;            _folderBrowser.Description = Value&lt;br /&gt;        End Set&lt;br /&gt;    End Property&lt;br /&gt;    Public Sub Reset()&lt;br /&gt;        _folderBrowser.Reset()&lt;br /&gt;    End Sub&lt;br /&gt;    Public Property RootFolder() As SpecialFolderWrapper&lt;br /&gt;        Get&lt;br /&gt;            Return _folderBrowser.RootFolder&lt;br /&gt;        End Get&lt;br /&gt;        Set(ByVal Value As SpecialFolderWrapper)&lt;br /&gt;            _folderBrowser.RootFolder = Value&lt;br /&gt;        End Set&lt;br /&gt;    End Property&lt;br /&gt;    Public Property SelectedPath() As String&lt;br /&gt;        Get&lt;br /&gt;            Return _folderBrowser.SelectedPath&lt;br /&gt;        End Get&lt;br /&gt;        Set(ByVal Value As String)&lt;br /&gt;            _folderBrowser.SelectedPath = Value&lt;br /&gt;        End Set&lt;br /&gt;    End Property&lt;br /&gt;    Public Function ShowDialog() As DialogResult&lt;br /&gt;        Return _folderBrowser.ShowDialog&lt;br /&gt;    End Function&lt;br /&gt;    Public Property ShowNewFolderButton() As Boolean&lt;br /&gt;        Get&lt;br /&gt;            Return _folderBrowser.ShowNewFolderButton&lt;br /&gt;        End Get&lt;br /&gt;        Set(ByVal Value As Boolean)&lt;br /&gt;            _folderBrowser.ShowNewFolderButton = Value&lt;br /&gt;        End Set&lt;br /&gt;    End Property&lt;br /&gt;&lt;br /&gt;End Class&lt;br /&gt;&lt;/pre&gt;There are a couple of important things to note in this class. First, you can see that the class uses the &lt;strong&gt;ComClass&lt;/strong&gt; attribute, and contains a number of GUIDs. These insure that this class  can be properly registered as a COM object, and be usable from Visual  Basic 6. Next, the class just provides simple wrappers that pass through  to the underlying .NET Framework &lt;strong&gt;FolderBrowserDialog&lt;/strong&gt; class. When the user calls &lt;strong&gt;ShowDialog&lt;/strong&gt; of the wrapper, &lt;strong&gt;ShowDialog&lt;/strong&gt; of the &lt;strong&gt;FolderBrowserDialog&lt;/strong&gt; class is called. When the user sets the &lt;strong&gt;Description&lt;/strong&gt; property of the wrapper, the &lt;strong&gt;Description&lt;/strong&gt; property of the &lt;strong&gt;FolderBrowserDialog&lt;/strong&gt; is set. In most cases, there&#39;s nothing overly complicated about the  wrapper classes. Their main purpose is to expose a COM interface, and  pass-through to the desired .NET framework class.&lt;br /&gt;  The following walkthough will take you, step-by-step, through the creation of a minimal wrapper around the &lt;strong&gt;FolderBrowserDialog&lt;/strong&gt;, to further your understanding of wrapper construction.&lt;br /&gt;  &lt;strong&gt;Walkthrough 4: Constructing a wrapper for the FolderBrowserDialog.&lt;/strong&gt;&lt;br /&gt;  The first task will be to create the wrapper class. Once it is created, you will use it from Visual Basic 6.  &lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;em&gt;(Visual Basic Express Only)&lt;/em&gt; Copy the &lt;strong&gt;ComClass.zip&lt;/strong&gt; file from the code download for this article to &lt;strong&gt;C:\Documents and Settings\[User Name]\My Documents\Visual Studio 2005\Templates\ItemTemplates\Visual Basic&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;Start &lt;strong&gt;Microsoft&lt;/strong&gt; &lt;strong&gt;Visual Basic 2005 Express Edition&lt;/strong&gt;, or &lt;strong&gt;Microsoft Visual Studio 2005&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Select the &lt;strong&gt;File | New Project&lt;/strong&gt; menu command. The wrapper class will be a class library project. This will compile to a DLL, much like a COM component would. &lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;New Project&lt;/strong&gt; dialog box: &lt;ol&gt;&lt;li&gt;&lt;em&gt;(VS 2005 Only)&lt;/em&gt; For &lt;strong&gt;Project Types&lt;/strong&gt;, select &lt;strong&gt;Visual Basic Projects&lt;/strong&gt;. &lt;/li&gt;&lt;li&gt;For &lt;strong&gt;Templates&lt;/strong&gt;, select &lt;strong&gt;Class Library&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;For &lt;strong&gt;Name&lt;/strong&gt;, enter &lt;strong&gt;FBWrapper&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt;.&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;Solution Explorer&lt;/strong&gt;, right-click &lt;strong&gt;Class1.vb&lt;/strong&gt; and select &lt;strong&gt;Delete&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt;. &lt;strong&gt;Class1&lt;/strong&gt; is not needed because it is a simple .NET  class, but not a COM class. For the wrapper, we need to create a COM  class so that it can be used as a COM object from Visual Basic 6. &lt;/li&gt;&lt;li&gt;Select the &lt;strong&gt;Project | Add New Item&lt;/strong&gt; menu command.&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;Add New Item&lt;/strong&gt; dialog box: &lt;ol&gt;&lt;li&gt;For &lt;strong&gt;Templates&lt;/strong&gt;, select &lt;strong&gt;COM Class&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;For &lt;strong&gt;Name&lt;/strong&gt; enter &lt;strong&gt;FolderBrowserDialogWrapper&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt;.&lt;/li&gt;&lt;/ol&gt;This has created the beginning of the wrapper class. Now you need to write the code that will wrap the &lt;strong&gt;FolderBrowserDialog&lt;/strong&gt; class. &lt;/li&gt;&lt;li&gt;Select the &lt;strong&gt;Project | Add Reference&lt;/strong&gt; menu command.&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;Add Reference&lt;/strong&gt; dialog box: &lt;ol&gt;&lt;li&gt;Click &lt;strong&gt;System.Windows.Forms.dll&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Click &lt;strong&gt;Select&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt;.&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;Above the &lt;strong&gt;Public Sub New&lt;/strong&gt; constructor, enter the following line of code: &lt;pre class=&quot;code&quot;&gt;Private fb As New System.Windows.Forms.FolderBrowserDialog&lt;br /&gt;This creates an instance of the FolderBrowserDialog which you are wrapping.&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;After &lt;strong&gt;Public Sub New&lt;/strong&gt;, but before &lt;strong&gt;End Class&lt;/strong&gt;, enter the following: &lt;pre class=&quot;code&quot;&gt;Public Function ShowDialog() As System.Windows.Forms.DialogResult&lt;br /&gt;    Return fb.ShowDialog()&lt;br /&gt;End Function&lt;br /&gt;&lt;/pre&gt;When the &lt;strong&gt;ShowDialog&lt;/strong&gt; function in your wrapper is called, it will pass the call through to the underlying &lt;strong&gt;FolderBrowserDialog&lt;/strong&gt; class. &lt;/li&gt;&lt;li&gt;Enter the following code to create a property that will allow your  Visual Basic 6 application to determine which folder was selected. &lt;pre class=&quot;code&quot;&gt;Public Property SelectedPath() As String&lt;br /&gt;    Get&lt;br /&gt;        Return fb.SelectedPath&lt;br /&gt;    End Get&lt;br /&gt;    Set(ByVal Value As String)&lt;br /&gt;        fb.SelectedPath = Value&lt;br /&gt;    End Set&lt;br /&gt;End Property&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Select the &lt;strong&gt;Build | Build FBWrapper&lt;/strong&gt; menu command. At this point, your wrapper is complete and can be used from Visual Basic 6. &lt;/li&gt;&lt;li&gt;Start &lt;strong&gt;Visual Basic 6&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;New Project&lt;/strong&gt; dialog box, select &lt;strong&gt;Standard Exe&lt;/strong&gt;, and click &lt;strong&gt;Open&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Select the &lt;strong&gt;Project | References &lt;/strong&gt;menu command.&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;References&lt;/strong&gt; dialog box, check &lt;strong&gt;FBWrapper&lt;/strong&gt;, and click &lt;strong&gt;OK&lt;/strong&gt;. You can see that your wrapper class appears in Visual Basic 6 just like any other COM object. You can just reference and use it. &lt;/li&gt;&lt;li&gt;Double-click the form to have the development environment generate the &lt;strong&gt;Form_Load&lt;/strong&gt; event handler, and switch you to the code editor.&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;Form_Load&lt;/strong&gt; event, enter the following code: &lt;pre class=&quot;code&quot;&gt;Dim fb As New FBWrapper.FolderBrowserDialogWrapper&lt;br /&gt;fb.ShowDialog&lt;br /&gt;MsgBox fb.SelectedPath&lt;br /&gt;&lt;/pre&gt;This creates an instance of the wrapper class, and displays the  folder browser dialog box. When the user selects a folder, the selected  folder is displayed in a message box. &lt;/li&gt;&lt;li&gt;Press &lt;strong&gt;F5&lt;/strong&gt; to run the application and display the folder browser.&lt;/li&gt;&lt;/ol&gt;Feel free to examine the other wrapper classes in IOLib, and you will  see that they are built exactly this way. They simply provide a COM  interface, and pass calls through to the underlying .NET framework  classes.&lt;br /&gt;  &lt;h2 class=&quot;dtH1&quot;&gt;Conclusion&lt;/h2&gt;In this article, you have seen that the .NET Framework exposes a  number of classes that are very useful when working with the file  system. The &lt;strong&gt;Path&lt;/strong&gt; class makes it easy to work with file  path strings and extract specific pieces of information, such as the  directory name, file name, and file extension. The &lt;strong&gt;FolderBrowserDialog&lt;/strong&gt; provides easy access to the system dialog box that allows the user to  select a folder. Finally, the file system watcher class makes it easy to  monitor folders for new files or changes. This article also includes a  component called IOLib that wraps these .NET classes, making them usable  from Visual Basic 6 or other COM environments, like Visual Basic for  Applications (VBA), ASP, or Visual Basic Scripting Edition (VBScript).  </content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/8961532430321191762/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/access-file-system-with-net-framework.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/8961532430321191762'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/8961532430321191762'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/access-file-system-with-net-framework.html' title='Access the File System with .NET Framework Classes from Visual Basic 6'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-5435948668637545501</id><published>2017-03-14T11:31:00.001-07:00</published><updated>2017-03-14T11:31:10.484-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>What&#39;s Going On? Accessing the Event Log from Visual Basic 6.0 Using the .NET Framework</title><content type='html'>&lt;div class=&quot;lw_vs&quot;&gt;    &lt;div id=&quot;curversion&quot;&gt;      &lt;strong&gt;                Visual Studio .NET 2003             &lt;/strong&gt;    &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;whatsgoing&quot;&gt;       &lt;/a&gt;  &amp;nbsp; Scott Swigart&lt;br /&gt;Swigart Consulting LLC&lt;br /&gt; April 2006&lt;br /&gt; Applies to:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Visual Basic 6.0&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;.NET Framework&lt;br /&gt; &lt;b&gt;Summary:&lt;/b&gt; This article explains how to  use .NET Framework classes to add rich event logging functionality to  existing Visual Basic 6.0 applications. (6 printed pages)&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;Contents&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719112.aspx#whatsgoing_topic1&quot;&gt;Introduction&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719112.aspx#whatsgoing_topic2&quot;&gt;The .NET Framework EventLog Class&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719112.aspx#whatsgoing_topic3&quot;&gt;Instrumentation&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719112.aspx#whatsgoing_topic4&quot;&gt;Reading the Logs&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719112.aspx#whatsgoing_topic5&quot;&gt;Conclusion&lt;/a&gt;&lt;br /&gt; Click &lt;a href=&quot;http://download.microsoft.com/download/2/0/f/20fc6fbe-a475-45e4-9a11-96c88b9f1b09/Whats_Going_On.msi&quot;&gt;here&lt;/a&gt; to download the code sample for this article.&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;whatsgoing_topic1&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;Visual Basic 6.0 provides some ability to write to the event log through &lt;b&gt;App.LogEvent&lt;/b&gt;,  but this API has a number of serious limitations. First, you aren&#39;t  able to define the source for your events (it always appears as  VBRuntime in the event viewer), and you can&#39;t specify the event ID or  category. You&#39;re also limited to writing to the Application event log,  and you can&#39;t create your own custom sources and logs.&lt;br /&gt; By using  the classes provided (for free) by the .NET Framework, you can overcome  all of these limitations, and effectively instrument your applications  so that you, administrators, or other support people can look at the  logs to diagnose issues.&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;whatsgoing_topic2&quot;&gt;&lt;/a&gt;The .NET Framework EventLog Class&lt;/h2&gt;The .NET Framework provides a powerful &lt;b&gt;EventLog&lt;/b&gt; class that makes it trivial to work with the event log. While you can&#39;t  access this class directly from Visual Basic 6.0, in the spirit of the &lt;a href=&quot;https://msdn.microsoft.com/vbrun/vbfusion/&quot;&gt;VB Fusion article series&lt;/a&gt;, I&#39;ve made this functionality accessible from Visual Basic 6.0 by creating a COM wrapper around the .NET classes. &lt;br /&gt; I&#39;ve also created a sample Visual Basic 6.0 application that exercises this event log functionality (see Figure&amp;nbsp;1).&lt;br /&gt; &lt;div class=&quot;fig&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC39682.gif&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 1. Visual Basic 6.0 application that uses event log functionality&lt;/b&gt;&lt;/div&gt;Most of the work in creating wrapper classes simply involves converting .NET types to types understood by Visual Basic 6.0. The &lt;b&gt;GetEventLogs&lt;/b&gt; method normally returns an array of &lt;b&gt;EventLog&lt;/b&gt; objects, and these &lt;b&gt;EventLog&lt;/b&gt; objects can&#39;t be used directly from Visual Basic 6.0. However, the  Visual Basic .NET function shown in Listing&amp;nbsp;1 returns a list of all the  event logs on the machine as an array of strings, which Visual Basic 6.0  can easily consume. Typically, you will have System, Security, and  Application event logs, but some applications also create their own  custom event logs, and this method will show you those as well.&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 1. Listing all the event logs on a machine using Visual Basic .NET&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-1&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_45f003a3-ad65-4a07-9b3b-918d7420ad26&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    Public Function GetEventLogs() As String()&lt;br /&gt;        Dim logs(EventLog.GetEventLogs.Length - 1) As String&lt;br /&gt;        Dim i As Integer = 0&lt;br /&gt;        For Each el As EventLog In EventLog.GetEventLogs()&lt;br /&gt;            logs(i) = el.Log&lt;br /&gt;            i += 1&lt;br /&gt;        Next&lt;br /&gt;        Return logs&lt;br /&gt;    End Function&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;As you can see from Listing&amp;nbsp;1, the &lt;b&gt;EventLog&lt;/b&gt; class lets you access all the event logs through the &lt;b&gt;GetEventLogs&lt;/b&gt; function. Once this is called, the function just iterates through the  results, and it returns all the event log names as an array of strings.  This Visual Basic .NET code can then be exposed as a COM object,  allowing it to be called from Visual Basic 6.0. &lt;br /&gt; Calling this from Visual Basic 6.0 and, for example, populating a &lt;b&gt;ListBox&lt;/b&gt; with the results is as simple as the code in Listing&amp;nbsp;2.&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 2. Displaying log names in a ListBox using Visual Basic 6.0&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-2&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_c2fe4699-df8a-4eb4-8511-0d9e69673932&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    Dim eventLog As NetFrameworkWrappers.EventLogWrapper&lt;br /&gt;    Set eventLog = New NetFrameworkWrappers.EventLogWrapper&lt;br /&gt;&lt;br /&gt;    lstEventLogs.Clear&lt;br /&gt;    &lt;br /&gt;    Dim logs() As String&lt;br /&gt;    logs = eventLog.GetEventLogs&lt;br /&gt;    &lt;br /&gt;    Dim log As Variant&lt;br /&gt;    For Each log In logs&lt;br /&gt;        lstEventLogs.AddItem log&lt;br /&gt;    Next&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;whatsgoing_topic3&quot;&gt;&lt;/a&gt;Instrumentation&lt;/h2&gt;You  may want your application to write to the event log for a variety of  reasons. Certainly, any catastrophic errors should go into the event  log, because this information can be used later to diagnose the problem.  Quite often, you may want to write detailed information to the event  log that would not be appropriate to show to the user.&lt;br /&gt; The first  choice is which log to use. You can choose from the System, Security, or  Application event logs. The Application event log is almost always the  right choice. However, you can also create your own custom event log if  you desire. Listing&amp;nbsp;3 shows the Visual Basic .NET code in the event log  wrapper that lets you create your own custom log.&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 3. Creating a custom event log using Visual Basic .NET&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-3&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_301fc3fe-85ca-433d-925b-dc3bc33f850c&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    Public Sub CreateEventSource(ByVal source As String, ByVal logName As String)&lt;br /&gt;        If EventLog.SourceExists(source) Then&lt;br /&gt;            EventLog.DeleteEventSource(source)&lt;br /&gt;        End If&lt;br /&gt;        EventLog.CreateEventSource(source, logName)&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;As you can see from Listing&amp;nbsp;3, the .NET Framework makes it easy to create an event log. The .NET &lt;b&gt;CreateEventSource&lt;/b&gt; method does all the work for you. This method just exposes that  functionality so that it&#39;s easy to call it from Visual Basic 6.0 (see  Listing&amp;nbsp;4).&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 4. Creating an event log from Visual Basic 6.0 with the wrapper class&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-4&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_7e86ca89-f6d0-4a8c-9ca4-7cf4bc68dfce&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    Dim eventLog As NetFrameworkWrappers.EventLogWrapper&lt;br /&gt;    Set eventLog = New NetFrameworkWrappers.EventLogWrapper&lt;br /&gt;    eventLog.CreateEventSource &quot;MyApplication&quot;, &quot;MyCustomLog&quot;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Writing an entry to the event log is equally simple. The &lt;b&gt;WriteEntry&lt;/b&gt; Visual Basic .NET method wraps the event log functionality and exposes  it so that it can be called from Visual Basic 6.0 (see Listing&amp;nbsp;5).&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 5. Writing an entry to the event log in Visual Basic .NET&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-5&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_d74995a3-c3b1-4219-91de-272b7e815d4e&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    Public Sub WriteEntry(ByVal source As String, _&lt;br /&gt;        ByVal message As String, _&lt;br /&gt;        Optional ByVal type As String = &quot;Information&quot;, _&lt;br /&gt;        Optional ByVal eventID As Integer = 0, _&lt;br /&gt;        Optional ByVal category As Short = 0)&lt;br /&gt;&lt;br /&gt;        Dim typeEnum As EventLogEntryType = _&lt;br /&gt;            System.Enum.Parse(GetType(EventLogEntryType), type)&lt;br /&gt;        m_eventLog.WriteEntry(source, message, typeEnum, eventID, category)&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This wrapper method exposes a number of optional arguments, so when  you call it from Visual Basic 6.0, you can pass in just the event log  source and message, or also the message type, event ID, and/or category.&lt;br /&gt; You can call this from Visual Basic 6.0 with the code in Listing&amp;nbsp;6.&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 6. Writing an event log entry from Visual Basic 6.0&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-6&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_87d73660-952e-417a-940e-4bbf4b1a6216&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    Dim eventLog As NetFrameworkWrappers.EventLogWrapper&lt;br /&gt;    Set eventLog = New NetFrameworkWrappers.EventLogWrapper&lt;br /&gt;    eventLog.WriteEntry cboLog.Text, txtMessage, cboType.Text, _&lt;br /&gt;        txtID, txtCategory&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;whatsgoing_topic4&quot;&gt;&lt;/a&gt;Reading the Logs&lt;/h2&gt;Reading the information out of the event logs is only slightly more complex. The .NET Framework &lt;b&gt;EventLog&lt;/b&gt; class has a &lt;b&gt;GetEntries&lt;/b&gt; method that will return all the log entries for a give event log  (Application, System, and so on). The problem is that each entry comes  back as an &lt;b&gt;EventLogEntry&lt;/b&gt; object, which can&#39;t be passed directly back to Visual Basic 6.0. However, it was simple for me to create my own &lt;b&gt;EventLogEntryInfo&lt;/b&gt; class that I could copy each event log entry into. This is a full COM  Class that can be returned to Visual Basic 6.0, and it exposes  properties for the entry source, message, type, ID, and category. The  Visual Basic .NET code then fills an array of these with the event log  entry data, and returns it so that it can be used from Visual Basic 6.0  (see Listing&amp;nbsp;7).&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 7. Reading and converting event log entries from Visual Basic .NET&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-7&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_728e5cea-b522-4d93-b5a2-3af7e3455259&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    Public Sub GetEntries(ByRef entries() As EventLogEntryInfo)&lt;br /&gt;        ReDim entries(m_eventLog.Entries.Count - 1)&lt;br /&gt;&lt;br /&gt;        For i As Integer = 0 To m_eventLog.Entries.Count - 1&lt;br /&gt;            Dim ent As EventLogEntry = m_eventLog.Entries(i)&lt;br /&gt;            entries(i) = New EventLogEntryInfo&lt;br /&gt;            entries(i).Category = ent.CategoryNumber&lt;br /&gt;            entries(i).Message = ent.Message&lt;br /&gt;            entries(i).Source = ent.Source&lt;br /&gt;            entries(i).EventID = ent.InstanceId&lt;br /&gt;            entries(i).EntryType = ent.EntryType&lt;br /&gt;        Next&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;When this function is completed, Visual Basic 6.0 has full access to the event log entries (see Listing&amp;nbsp;8).&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 8. Getting the Event Log entries from Visual Basic 6.0&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-8&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_4e18223a-14fe-4562-b92d-e82e63a8a427&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    Dim eventLog As NetFrameworkWrappers.EventLogWrapper&lt;br /&gt;    Set eventLog = New NetFrameworkWrappers.EventLogWrapper&lt;br /&gt;    eventLog.Init logName&lt;br /&gt;&lt;br /&gt;    Dim entries() As NetFrameworkWrappers.EventLogEntryInfo&lt;br /&gt;    eventLog.GetEntries entries&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;whatsgoing_topic5&quot;&gt;&lt;/a&gt;Conclusion&lt;/h2&gt;I  believe that you don&#39;t need to rewrite existing Visual Basic 6.0  applications in order to take advantage of the extensive functionality  provided by the .NET framework. As the Visual Basic Fusion articles  show, with simple wrapper classes, you can expose the functionality of  the .NET Framework as COM objects, which can be used from Visual Basic  6.0, VBA, ASP, or any environment that can access COM objects. In this  article, you saw how you could add rich event logging functionality to  existing Visual Basic 6.0 applications. Feel free to download the  associated sample code to add event logging to your applications today.</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/5435948668637545501/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/whats-going-on-accessing-event-log-from.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/5435948668637545501'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/5435948668637545501'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/whats-going-on-accessing-event-log-from.html' title='What&#39;s Going On? Accessing the Event Log from Visual Basic 6.0 Using the .NET Framework'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-6538106852045929294</id><published>2017-03-14T11:29:00.000-07:00</published><updated>2017-03-14T11:29:02.854-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Environmental Awareness: Accessing Operating System Information, Special Folders, and More with Visual Basic 6 and the .NET Framework</title><content type='html'>&lt;div class=&quot;lw_vs&quot;&gt;    &lt;div id=&quot;curversion&quot;&gt;      &lt;strong&gt;                Visual Studio .NET 2003             &lt;/strong&gt;    &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;environaware&quot;&gt;       &lt;/a&gt;  &amp;nbsp; Scott Swigart&lt;br /&gt;Swigart Consulting LLC&lt;br /&gt; April 2006&lt;br /&gt; Applies to:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Visual Basic 6&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;.NET Framework&lt;br /&gt; &lt;b&gt;Summary:&lt;/b&gt; This article explains how you  can use Visual Basic 6 with the .NET Framework to access user and  operating system information that normally would require Win32 API  calls. (8 printed pages)&lt;br /&gt; &lt;h4 class=&quot;dtH1&quot;&gt;Contents&lt;/h4&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719099.aspx#environaware_topic1&quot;&gt;Introduction&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719099.aspx#environaware_topic2&quot;&gt;Spin the Wheel of Win32&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719099.aspx#environaware_topic3&quot;&gt;Welcome to System.Environment&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719099.aspx#environaware_topic4&quot;&gt;Wrapping It Up&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719099.aspx#environaware_topic5&quot;&gt;All Boxed Up&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719099.aspx#environaware_topic6&quot;&gt;Additional Resources&lt;/a&gt;&lt;br /&gt; Click &lt;a href=&quot;http://download.microsoft.com/download/d/3/7/d378d5e4-5e83-41f5-81e9-ae5cfe2cbd82/EnvironmentalAwareness.msi&quot;&gt;here&lt;/a&gt; to download the code sample for this article.&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;environaware_topic1&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;There&#39;s  a lot of user and operating system information that&#39;s typically been  difficult to get to from Visual Basic 6; however, with a few trivial  calls into the .NET Framework, this information is easy to retrieve.&lt;br /&gt; Figure&amp;nbsp;1 illustrates the retrieval of user and operating system information from Visual Basic 6 with the .NET Framework.&lt;br /&gt; &lt;div class=&quot;fig&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC33548.gif&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 1. Retrieving user and operating system information&lt;/b&gt;&lt;/div&gt;You  can see that this application retrieves the domain name, user name, and  machine name.  It also retrieves the string for the operating system  version, letting you know what OS your code is running on.  The logical  drives are enumerated, and the IP addresses assigned to this machine are  also listed—in this case, showing the physical and wireless IP  addresses.&lt;br /&gt; In addition, the application is able to retrieve the location for any of the special folders, which include:  &lt;br /&gt;&lt;ul type=&quot;disc&quot;&gt;&lt;li&gt;Desktop&lt;/li&gt;&lt;li&gt;Programs&lt;/li&gt;&lt;li&gt;Personal&lt;/li&gt;&lt;li&gt;Favorites&lt;/li&gt;&lt;li&gt;StartUp&lt;/li&gt;&lt;li&gt;Recent&lt;/li&gt;&lt;li&gt;SendTo&lt;/li&gt;&lt;li&gt;StartMenu&lt;/li&gt;&lt;li&gt;MyMusic&lt;/li&gt;&lt;li&gt;DesktopDirectory&lt;/li&gt;&lt;li&gt;MyComputer&lt;/li&gt;&lt;li&gt;Templates&lt;/li&gt;&lt;li&gt;ApplicationData&lt;/li&gt;&lt;li&gt;LocalApplicationData&lt;/li&gt;&lt;li&gt;InternetCache&lt;/li&gt;&lt;li&gt;Cookies&lt;/li&gt;&lt;li&gt;History&lt;/li&gt;&lt;li&gt;CommonApplicationData&lt;/li&gt;&lt;li&gt;System&lt;/li&gt;&lt;li&gt;ProgramFiles&lt;/li&gt;&lt;li&gt;MyPictures&lt;/li&gt;&lt;li&gt;CommonProgramFiles&lt;/li&gt;&lt;/ul&gt;&lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;environaware_topic2&quot;&gt;&lt;/a&gt;Spin the Wheel of Win32&lt;/h2&gt;To  do this with 100% Visual Basic 6 would have required a lot of calls  into the Win32 API, and all the goo that Win32 API calls entail.  You  would have to correctly create your &lt;b&gt;Declare&lt;/b&gt; statements, craft  structures that match what the API functions need, create buffers to  hold strings, and so on.  Not to mention that there are a number of API  functions that do similar things, some of which are available on one  operating system, but not others.&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;environaware_topic3&quot;&gt;&lt;/a&gt;Welcome to System.Environment&lt;/h2&gt;The .NET Framework Class Library (FCL) organizes access to much of this system information under the &lt;b&gt;System.Enviornment&lt;/b&gt; class.  Tables&amp;nbsp;1 and 2 present a quick overview of this class, showing  that it can provide a lot of information about the machine, user, and  application environment.&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Table 1. System.Environment properties&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;tablediv&quot;&gt;&lt;div class=&quot;contentTableWrapper&quot;&gt;&lt;table class=&quot;dtTABLE&quot; summary=&quot;table&quot;&gt; &lt;tbody&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;th scope=&quot;col&quot; width=&quot;42%&quot;&gt;System.Environment Property&lt;/th&gt; &lt;th scope=&quot;col&quot; width=&quot;35%&quot;&gt;Description&lt;/th&gt; &lt;th scope=&quot;col&quot; width=&quot;23%&quot;&gt;Visual Basic 6 Equivalent&lt;/th&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Property&quot; width=&quot;42%&quot;&gt;&lt;b&gt;CommandLine&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Gets the command line for this process.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;Command function&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Property&quot; width=&quot;42%&quot;&gt;&lt;b&gt;CurrentDirectory&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Gets and sets the fully qualified path of the current directory—that is, the directory from which this process starts.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;App.Path&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Property&quot; width=&quot;42%&quot;&gt;&lt;b&gt;ExitCode&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Gets or sets the exit code of the process.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;No equivalent&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Property&quot; width=&quot;42%&quot;&gt;&lt;b&gt;HasShutdownStarted&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Indicates whether the common language runtime is shutting down, or whether the current application domain is unloading.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;Win32 API&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Property&quot; width=&quot;42%&quot;&gt;&lt;b&gt;MachineName&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Gets the NetBIOS name of this local computer.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;Win32 API&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Property&quot; width=&quot;42%&quot;&gt;&lt;b&gt;NewLine&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Gets the newline string defined for this environment.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;No equivalent&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Property&quot; width=&quot;42%&quot;&gt;&lt;b&gt;OSVersion&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Gets an &lt;b&gt;OperatingSystem&lt;/b&gt; object that contains the current platform identifier and version number.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;Win32 API&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Property&quot; width=&quot;42%&quot;&gt;&lt;b&gt;StackTrace&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Gets current stack trace information.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;No equivalent&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Property&quot; width=&quot;42%&quot;&gt;&lt;b&gt;SystemDirectory&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Gets the fully qualified path of the system directory.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;Win32 API&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Property&quot; width=&quot;42%&quot;&gt;&lt;b&gt;TickCount&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Gets the number of milliseconds that have elapsed since the system started.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;Win32 API&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Property&quot; width=&quot;42%&quot;&gt;&lt;b&gt;UserDomainName&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Gets the network domain name associated with the current user.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;Win32 API&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Property&quot; width=&quot;42%&quot;&gt;&lt;b&gt;UserInteractive&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Gets a value indicating whether the current process is running in user interactive mode.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;Win32 API&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Property&quot; width=&quot;42%&quot;&gt;&lt;b&gt;UserName&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Gets the user name of the person who started the current thread.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;Win32 API&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Property&quot; width=&quot;42%&quot;&gt;&lt;b&gt;Version&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Gets a &lt;b&gt;Version&lt;/b&gt; object that describes the major, minor, build, and revision numbers of the common language runtime.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;Win32 API&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Property&quot; width=&quot;42%&quot;&gt;&lt;b&gt;WorkingSet&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Gets the amount of physical memory mapped to the process context.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;Win32 API&lt;/td&gt; &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Table 2. System.Environment methods&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;tablediv&quot;&gt;&lt;div class=&quot;contentTableWrapper&quot;&gt;&lt;table class=&quot;dtTABLE&quot; summary=&quot;table&quot;&gt; &lt;tbody&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;th scope=&quot;col&quot; width=&quot;42%&quot;&gt;System.Environment Method&lt;/th&gt; &lt;th scope=&quot;col&quot; width=&quot;35%&quot;&gt;Description&lt;/th&gt; &lt;th scope=&quot;col&quot; width=&quot;23%&quot;&gt;Visual Basic 6 Equivalent&lt;/th&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Method&quot; width=&quot;42%&quot;&gt;&lt;b&gt;Exit&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Terminates this process and gives the underlying operating system the specified exit code.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;End or Win32 API&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Method&quot; width=&quot;42%&quot;&gt;&lt;b&gt;ExpandEnvironmentVariables&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Replaces  the name of each environment variable embedded in the specified string  with the string equivalent of the value of the variable, and then  returns the resulting string.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;Environ function and custom code&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Method&quot; width=&quot;42%&quot;&gt;&lt;b&gt;GetCommandLineArgs&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Returns a string array containing the command-line arguments for the current process.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;Command function&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Method&quot; width=&quot;42%&quot;&gt;&lt;b&gt;GetEnvironmentVariable&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Returns the value of the specified environment variable.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;Environ function&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Method&quot; width=&quot;42%&quot;&gt;&lt;b&gt;GetEnvironmentVariables&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Returns all environment variables and their values.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;Environ function&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Method&quot; width=&quot;42%&quot;&gt;&lt;b&gt;GetFolderPath&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Gets the path to the system special folder identified by the specified enumeration.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;Win32 API&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;System.Environment Method&quot; width=&quot;42%&quot;&gt;&lt;b&gt;GetLogicalDrives&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Description&quot; width=&quot;35%&quot;&gt;Returns an array of strings containing the names of the logical drives on the current computer.&lt;/td&gt; &lt;td data-th=&quot;Visual Basic 6 Equivalent&quot; width=&quot;23%&quot;&gt;Win32 API&lt;/td&gt; &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;As you can see from Tables 1 and 2, the &lt;b&gt;System.Environment&lt;/b&gt; class provides a lot of information that isn&#39;t readily accessible from Visual Basic 6.  To use the &lt;b&gt;System.Environment&lt;/b&gt; class, you can create a simple COM wrapper class in Visual Basic .NET.  Once the COM wrapper is created, you can use the &lt;b&gt;System.Environment&lt;/b&gt; class from Visual Basic 6, VBA, ASP, VBScript, or any other environment that can use COM objects.&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;environaware_topic4&quot;&gt;&lt;/a&gt;Wrapping It Up&lt;/h2&gt;To create a wrapper for the &lt;b&gt;System.Environment&lt;/b&gt; class, you can just create a new Class Library project in Visual Studio  .NET 2003, and add a COM Class to your project (see Figure&amp;nbsp;2).&lt;br /&gt; &lt;div class=&quot;fig&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC98673.gif&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 2. Adding a COM Class to your project&lt;/b&gt;&lt;/div&gt;You then simply create functions that call into the &lt;b&gt;System.Environment&lt;/b&gt; methods and properties, and return the results (see Listing&amp;nbsp;1).  In many cases, this involves just one line of code.&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 1. Returning System.Environment information from Visual Basic .NET&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-1&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_fc2f15c4-c213-4da8-9c8e-2cba053ea1d0&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    Public Function GetLogicalDrives() As String()&lt;br /&gt;        Return System.Environment.GetLogicalDrives()&lt;br /&gt;    End Function&lt;br /&gt;&lt;br /&gt;    Public Function GetMachineName() As String&lt;br /&gt;        Return System.Environment.MachineName&lt;br /&gt;    End Function&lt;br /&gt;&lt;br /&gt;    Public Function GetOSVersion() As String&lt;br /&gt;        Return System.Environment.OSVersion.ToString()&lt;br /&gt;    End Function&lt;br /&gt;&lt;br /&gt;    Public Function GetDomainName() As String&lt;br /&gt;        Return System.Environment.UserDomainName()&lt;br /&gt;    End Function&lt;br /&gt;&lt;br /&gt;    Public Function GetUserName() As String&lt;br /&gt;        Return System.Environment.UserName&lt;br /&gt;    End Function&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;These functions can then be called from Visual Basic 6 to get the information (see Listing&amp;nbsp;2).&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 2. Accessing System.Environment from Visual Basic 6&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-2&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_d8c2002e-89d7-4573-8e92-60a8aa879a34&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    Set env = New NetFrameworkWrappers.EnvironmentWrapper&lt;br /&gt;    txtDomainName = env.GetDomainName&lt;br /&gt;    txtUserName = env.GetUserName&lt;br /&gt;    txtMachineName = env.GetMachineName&lt;br /&gt;    txtOsVersion = env.GetOSVersion&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;To get the directory for special folders, you need to specify which  folder you&#39;re interested in.  .NET provides an enumeration of all the  possible folders, and this list can easily be provided to Visual Basic 6  as an array of strings (see Listing&amp;nbsp;3).&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 3. Returning the list of special folders from Visual Basic .NET&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-3&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_a219ff0d-3782-4ab3-a1d9-cb118014fd5b&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    Public Function ValidFolderPaths() As String()&lt;br /&gt;        Return System.Enum.GetNames(GetType(SpecialFolder))&lt;br /&gt;    End Function&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This returns an array of strings with the identifiers for all the  special folders.  You can then pass in the ID of the special folder to  get its directory location (see Listing&amp;nbsp;4).&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 4. Visual Basic .NET function that returns the directory location for a special folder&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-4&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_9198d849-f65d-4356-9f78-d4f8f956279b&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    Public Function GetFolderPath(ByVal specialName As String) As String&lt;br /&gt;        Dim sf As SpecialFolder&lt;br /&gt;        sf = System.Enum.Parse(GetType(SpecialFolder), specialName)&lt;br /&gt;        Return System.Environment.GetFolderPath(sf)&lt;br /&gt;    End Function&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;From Visual Basic 6, you can just call this function, pass in any  special folder ID string, and get the location (see Listing&amp;nbsp;5).&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 5. Retrieving a special folder location from Visual Basic 6&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-5&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_d18880ac-cbfb-46a3-8e7d-1a01bcc9ec66&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    Set env = New NetFrameworkWrappers.EnvironmentWrapper&lt;br /&gt;    txtMyPictures = env.GetFolderPath(&quot;MyPictures&quot;)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Information about the current system IP addresses isn&#39;t actually provided through &lt;b&gt;System.Environment&lt;/b&gt;, but to me, it&#39;s part of the same theme.  For this, I actually use classes in the &lt;b&gt;System.Network&lt;/b&gt; namespace (see Listing&amp;nbsp;6).&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 6. Returning IP Addresses from Visual Basic .NET&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-6&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_c302a307-0037-4b14-9b02-af2ba4af81f8&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    Public Function GetIpAddresses() As String()&lt;br /&gt;        Dim h As System.Net.IPHostEntry = _&lt;br /&gt;            System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName)&lt;br /&gt;        Dim addresses(h.AddressList.Length - 1) As String&lt;br /&gt;        For i As Integer = 0 To h.AddressList.Length - 1&lt;br /&gt;            addresses(i) = h.AddressList(i).ToString()&lt;br /&gt;        Next&lt;br /&gt;        Return addresses&lt;br /&gt;    End Function&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This function first gets the host name for the computer using the &lt;b&gt;Dns&lt;/b&gt; class.  Then, it retrieves the IP addresses for that host name.  The information is returned as an array of strings.&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;environaware_topic5&quot;&gt;&lt;/a&gt;All Boxed Up&lt;/h2&gt;As a convenience, I&#39;ve already created the wrapper class for &lt;b&gt;System.Environment&lt;/b&gt;.   The code for the wrapper, and the test application illustrated in  Figure 1 are ready for you to download and experiment with.  To install  the COM wrapper, just execute install.bat, which is located in the  download zip file.  You can then find the Visual Basic 6 application in  the VB6 Projects\Environment folder.  The full .NET wrapper solution is  available in the VB.NET Wrappers folder.&lt;br /&gt; The theme of Visual  Basic Fusion is that you can use everything that .NET offers from  non-.NET environments such as Visual Basic 6, VBA, ASP, or VBScript.  In  this article, you&#39;ve seen how you can access information that normally  would have required Win32 API calls, with just a tiny bit of .NET code.</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/6538106852045929294/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/environmental-awareness-accessing.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/6538106852045929294'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/6538106852045929294'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/environmental-awareness-accessing.html' title='Environmental Awareness: Accessing Operating System Information, Special Folders, and More with Visual Basic 6 and the .NET Framework'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-444051914793721680</id><published>2017-03-14T11:26:00.003-07:00</published><updated>2017-03-14T11:26:32.719-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Implementing File Compression and Encryption in Visual Basic 6 Using the Microsoft .NET Framework, Part II: Compression</title><content type='html'>&lt;div class=&quot;topic&quot;&gt;&lt;div class=&quot;lw_vs&quot;&gt;    &lt;div id=&quot;curversion&quot;&gt;      &lt;strong&gt;                Visual Studio .NET 2003             &lt;/strong&gt;    &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;vbcompii&quot;&gt;       &lt;/a&gt;  &lt;div id=&quot;nstext&quot; valign=&quot;bottom&quot;&gt;&amp;nbsp; Scott Swigart&lt;br /&gt;Swigart Consulting LLC.&lt;br /&gt; February 2006&lt;br /&gt; Applies to:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft Visual Basic 6&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft Visual Basic .NET 2003&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft Visual Basic 2005&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft Visual Studio .NET 2003&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft Visual Studio 2005&lt;br /&gt; &lt;b&gt;Summary:&lt;/b&gt; In this two-part  article series, you&#39;ll see how you can easily add encryption and data  compression (ZIP) capabilities to existing Visual Basic 6 applications  using the .NET Framework. While encryption and compression may not seem  like related technologies, if you think about it, each one takes a set  of data and performs a transformation on it. In the case of encryption,  the data is made unreadable, and with compression, the data is made  smaller. You&#39;ll also see that both utilize many of the same underlying  technologies. (8 printed pages)&lt;br /&gt; Click &lt;a href=&quot;http://download.microsoft.com/download/6/8/c/68c96a9c-8c18-4c9f-8d21-89d4ae1b8eeb/fusion_small_part2.msi&quot;&gt;here&lt;/a&gt; to download the code sample for this article.&lt;br /&gt; &lt;br /&gt; &lt;h4 class=&quot;dtH1&quot;&gt;Contents&lt;/h4&gt;&lt;a href=&quot;https://msdn.microsoft.com/library/aa719106%28vs.71%29.aspx#vbcompii_topic1&quot;&gt;Introduction&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/library/aa719106%28vs.71%29.aspx#vbcompii_topic2&quot;&gt;Compression&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/library/aa719106%28vs.71%29.aspx#vbcompii_topic3&quot;&gt;Zipping Files and Folders&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/library/aa719106%28vs.71%29.aspx#vbcompii_topic4&quot;&gt;Running the Sample&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/library/aa719106%28vs.71%29.aspx#vbcompii_topic5&quot;&gt;Conclusion&lt;/a&gt;&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;vbcompii_topic1&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;So  far, in the Visual Basic Fusion article series, you&#39;ve been exposed to a  significant amount of functionality provided by the Microsoft .NET  Framework, but you should also know that there is an enormous amount of  high quality open-source code that is also easy to use from your Visual  Basic 6 applications. By creating very lightweight wrappers, you can  expose functionality in open-source and third party libraries—originally  developed for use in .NET applications—to extend your Visual Basic 6  applications. Sites like &lt;a href=&quot;http://sourceforge.net/index.php&quot;&gt;www.sourceforge.net&lt;/a&gt; and &lt;a href=&quot;http://www.gotdotnet.com/&quot;&gt;www.gotdotnet.com&lt;/a&gt; contain literally thousands of open-source projects, providing an  extremely broad range of additional functionality. Just a few examples  include libraries for RS232 (serial port) communication, working with  RSS feeds, working with images and media files, network libraries, FTP  libraries, file replication, and thousands of other libraries. &lt;br /&gt; This article will look at utilizing one such open-source library for file compression. &lt;a href=&quot;http://www.icsharpcode.net/opensource/sharpziplib/default.aspx/&quot;&gt;SharpZipLib&lt;/a&gt; is an open-source project that provides compression (ZIP)  functionality. Version 2.0 of the .NET Framework also contains some  support for file compression, but SharpZipLib affords more compression  options, and makes it easier to create zip archives of whole folders.  You can freely include this library even in close-source, for-sale  software if you desire. &lt;br /&gt; Before digging into the details of using  SharpZipLib, it&#39;s worth comparing how .NET file I/O differs from Visual  Basic 6 file I/O. As a quick review, Visual Basic 6 uses keywords to  control file input and output.&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Example 1. Reading for a file with Visual Basic 6&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-1&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_b6a399ac-1d38-4ec9-9ce2-fae8974a2289&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Dim dataIn As String&lt;br /&gt;Open someFileName For Input As #1&lt;br /&gt;Do Until Eof(1)&lt;br /&gt;    Line Input #1, dataIn&lt;br /&gt;    Debug.Print dataIn&lt;br /&gt;Loop&lt;br /&gt;Close #1&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;In Visual Basic .NET, you would instead use some specific classes in the .NET Framework to perform File I/O operations.&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Example 2. Visual Basic .NET File IO&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-2&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_fa44064e-a35d-4b73-8e68-7ef93169e04e&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Dim dataIn As String&lt;br /&gt;Dim sw As New StreamWriter(&quot;C:\log.txt&quot;)&lt;br /&gt;sw.WriteLine(&quot;This is a test&quot;)&lt;br /&gt;sw.Close()&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;With Visual Basic 6, you have to manage file handles, and you have  to know the associated language keywords needed to work with that file  handle. With Visual Basic .NET, the StreamWriter class wraps up all the  functionality associated with files. You don&#39;t need to manage the file  handles, and the file operations are more discoverable, because you have  IntelliSense that will show you all the operations (WriteLine and  others) available when working with files. &lt;br /&gt; But the real  advantage of these objects (also known as streams) is that they let you  stack file I/O functionality. In the first article, you saw how  encryption was supported by just adding a &lt;b&gt;CryptoStream&lt;/b&gt; to the stack of I/O streams.&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Example 3. Stacking streams to enable encryption with Visual Basic .NET&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-3&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_a58a18b4-4405-40ce-b861-d12301933216&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;fs = New FileStream(fileName, FileMode.Create, FileAccess.Write)&lt;br /&gt;cs = New CryptoStream(fs, rc2.CreateEncryptor(), CryptoStreamMode.Write)&lt;br /&gt;sw = New StreamWriter(cs)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;So anything written to the &lt;b&gt;StreamWriter&lt;/b&gt; is then sent through the &lt;b&gt;CyrptoStream&lt;/b&gt;, where it is encrypted, and then sent to the &lt;b&gt;FileStream&lt;/b&gt; where it is written to disk.&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;vbcompii_topic2&quot;&gt;&lt;/a&gt;Compression&lt;/h2&gt;Compression works exactly the same way.&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Example 4. Stacking streams to enable compression with Visual Basic .NET&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-4&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_ae8b4e57-96d2-4927-9a2a-14d27f660062&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Dim fs = New FileStream(fileName, FileMode.Create, FileAccess.Write)&lt;br /&gt;zs = New GZipOutputStream(fs)&lt;br /&gt;sw = New StreamWriter(zs)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;As you can see, compression composes with File IO exactly the same  way as encryption, which makes sense. Both encryption and compression  are really just a transformation of the data. With encryption, the data  is transformed to a format that&#39;s not readable without a key. With  compression, the data is transformed so that it requires fewer bytes to  represent the same data. &lt;br /&gt; The entire .NET class that enables you to write out information to a compressed file is as follows.&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Example 5. Entire Visual Basic .NET class needed to allow you to write to a compressed file &lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-5&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_082b2fd9-f5a4-47a9-9a14-6c077d62362b&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Public Class GZipFileWriterWrapper&lt;br /&gt;    Private fs As FileStream&lt;br /&gt;    Private zs As GZipOutputStream&lt;br /&gt;    Private sw As StreamWriter&lt;br /&gt;&lt;br /&gt;    Public Sub Open(ByVal fileName As String)&lt;br /&gt;        fs = New FileStream(fileName, FileMode.Create, FileAccess.Write)&lt;br /&gt;        zs = New GZipOutputStream(fs)&lt;br /&gt;        sw = New StreamWriter(zs)&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;    Public Sub WriteLine(ByVal value As String)&lt;br /&gt;        sw.WriteLine(value)&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;    Public Sub Write(ByVal value As String)&lt;br /&gt;        sw.Write(value)&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;    Public Sub WriteBytes(ByRef bytes() As Byte)&lt;br /&gt;        zs.Write(bytes, 0, bytes.Length)&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;    Public Sub Close()&lt;br /&gt;        On Error Resume Next&lt;br /&gt;        If Not sw Is Nothing Then sw.Close()&lt;br /&gt;        If Not zs Is Nothing Then zs.Close()&lt;br /&gt;        If Not fs Is Nothing Then fs.Close()&lt;br /&gt;    End Sub&lt;br /&gt;End Class&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Now it&#39;s time to use this from a Visual Basic 6 application, to  write information out to a compressed file. With this wrapper in place,  the Visual Basic 6 code is trivial.&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Example 6. Visual Basic 6 code to write to a compressed file&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-6&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_5236b633-9a6f-4d72-ba14-853fe709468a&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Dim e As wrappers.GZipFileWriterWrapper&lt;br /&gt;Set e = New wrappers.GZipFileWriterWrapper&lt;br /&gt;    &lt;br /&gt;e.Open &quot;c:\file.gzip&quot;&lt;br /&gt;e.WriteLine (txtMessage)&lt;br /&gt;e.Close&lt;br /&gt;    &lt;br /&gt;txtMessage = &quot;&quot;&lt;br /&gt;MsgBox &quot;Compressed and Saved&quot;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;You can see that you simply use the wrapper to open the file, write  as much as you want to it, and then close it when you&#39;re done. If you  try to just open the disk file with something like Notepad, you can see  that it has been written in a binary compressed format.&lt;br /&gt; &lt;div class=&quot;fig&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC170319.gif&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 1. Examining the compressed file&lt;/b&gt;&lt;/div&gt;However, using a Visual Basic 6 application, you can easily use the wrapper to read the compressed information back in.&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Example 7. Reading the compressed file with Visual Basic 6&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-7&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_ac680bad-e3e5-4c0c-a2fe-5f4ce411ad3d&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;e.Open &quot;c:\file.gzip&quot;&lt;br /&gt;While Not e.EOF&lt;br /&gt;    txtMessage = txtMessage &amp;amp; e.ReadLine &amp;amp; vbCrLf&lt;br /&gt;    &#39; Could also just use e.ReadToEnd to read&lt;br /&gt;    &#39; the entire file.&lt;br /&gt;Wend&lt;br /&gt;e.Close&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;vbcompii_topic3&quot;&gt;&lt;/a&gt;Zipping Files and Folders&lt;/h2&gt;The  kind of compression shown so far lets you compress information before  placing it into a file. However, it&#39;s common to want to create a zip  archive, where you have a zip file that contains one or more disk files.  This functionality is provided with the following wrapper around the  SharpZipLib.&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Example 8. Visual Basic .NET wrapper to create a Zip archive &lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-8&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_55b9db6b-d404-4856-afb4-1fdd0df0b07d&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Public Sub ZipFile(ByVal source As String, ByVal dest As String)&lt;br /&gt;&lt;br /&gt;    Dim entry As New ZipEntry(Path.GetFileName(source))&lt;br /&gt;    Dim fi As New FileInfo(source)&lt;br /&gt;    entry.ExternalFileAttributes = fi.Attributes&lt;br /&gt;    entry.Size = fi.Length&lt;br /&gt;&lt;br /&gt;    Dim input As FileStream = File.OpenRead(source)&lt;br /&gt;    Dim output As New ZipOutputStream(File.Create(dest))&lt;br /&gt;&lt;br /&gt;    output.PutNextEntry(entry)&lt;br /&gt;&lt;br /&gt;    Dim buffer(8191) As Byte&lt;br /&gt;    Dim len As Integer&lt;br /&gt;    Do&lt;br /&gt;        len = input.Read(buffer, 0, buffer.Length)&lt;br /&gt;        If len &amp;gt; 0 Then&lt;br /&gt;            output.Write(buffer, 0, len)&lt;br /&gt;        End If&lt;br /&gt;    Loop Until len = 0&lt;br /&gt;    output.Close()&lt;br /&gt;    input.Close()&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Here, the &lt;b&gt;ZipEntry&lt;/b&gt; class is used to write information about the file that will be added to the archive. Once the &lt;b&gt;ZipEntry&lt;/b&gt; is written to the &lt;b&gt;ZipOutputStream&lt;/b&gt;,  the actual file contents are written. The result is a zip archive that  can be opened using WinZip, or the zip functionality built into Windows  XP. Now that the wrapper is built, zipping a file from Visual Basic 6 is  as simple as the following.&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Example 9. Zipping a file from Visual Basic 6&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-9&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_8926de15-c477-43b0-a90c-c33a56e76337&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;CommonDialog1.ShowOpen&lt;br /&gt;Dim source As String&lt;br /&gt;source = CommonDialog1.FileName&lt;br /&gt;    &lt;br /&gt;Dim e As wrappers.FileZipWrapper&lt;br /&gt;Set e = New wrappers.FileZipWrapper&lt;br /&gt;e.ZipFile source, source &amp;amp; &quot;.zip&quot;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This prompts the user for a file to zip, and then uses the wrapper  to zip the file. The result is a zip archive that is readable by Windows  XP or other zip readers.&lt;br /&gt; &lt;div class=&quot;fig&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC108581.gif&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 2. Zipping a single file&lt;/b&gt;&lt;/div&gt;Finally, you may want to zip an entire folder, and a wrapper is provided for that, as well.&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Example 10. Visual Basic 6 code to zip and entire folder structure&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-10&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_e4b1dcc2-3c74-4de8-b12d-a0477551430e&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Dim e As wrappers.FileZipWrapper&lt;br /&gt;Set e = New wrappers.FileZipWrapper&lt;br /&gt;    &lt;br /&gt;e.ZipFolder App.Path, App.Path &amp;amp; &quot;\..\file.zip&quot;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;vbcompii_topic4&quot;&gt;&lt;/a&gt;Running the Sample&lt;/h2&gt;In &lt;a href=&quot;https://msdn.microsoft.com/id-id/library/aa719107%28v=vs.71%29.aspx&quot;&gt;part I&lt;/a&gt; of this article series, we created a sample that would let you exercise  the encryption functionality. I&#39;ve modified that sample to instead use  the compression wrappers provided here. To use the sample:   &lt;br /&gt;&lt;ol type=&quot;1&quot;&gt;&lt;li&gt;Download and install the &lt;a href=&quot;https://www.microsoft.com/downloads/details.aspx?familyid=fe6f2099-b7b4-4f47-a244-c96d69c35dec&amp;amp;displaylang=en&quot;&gt;.NET Framework 2.0 Software Development Kit&lt;/a&gt; (if you have Visual Studio .NET 2005 or Visual Basic Express installed, you can skip this step). &lt;/li&gt;&lt;li&gt;Download the code associated with this article. &lt;/li&gt;&lt;li&gt;Execute  the &quot;Install.bat&quot; file included with the code for this article. This  registers the encryption component so that you can use it from your  Visual Basic 6 application. &lt;/li&gt;&lt;li&gt;In the code for this article, open the Visual Basic 6 project in the &quot;Compression&quot; folder. &lt;/li&gt;&lt;li&gt;Press &lt;b&gt;F5&lt;/b&gt; to run the sample application: &lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC79646.gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 3. Form 1&lt;/b&gt; &lt;/div&gt;&lt;/li&gt;&lt;li&gt;When you click &lt;b&gt;Compress&lt;/b&gt;, the text in the textbox will be written to a file using the &lt;b&gt;GZip&lt;/b&gt; compression algorithm. When you click &lt;b&gt;Decompress&lt;/b&gt;, the contents will be decrypted and displayed. &lt;/li&gt;&lt;li&gt;Clicking &lt;b&gt;Zip File&lt;/b&gt; will prompt you to choose a file, and will create a zip archive that contains the file. Clicking &lt;b&gt;Unzip&lt;/b&gt; will extract the file from the archive. &lt;/li&gt;&lt;li&gt;Finally, Clicking &lt;b&gt;Zip Folder&lt;/b&gt; will compress the contents of an entire folder. &lt;/li&gt;&lt;/ol&gt;To use this functionality from your own application, just run &quot;Install.bat&quot; and then add a reference to &quot;wrappers.dll.&quot;&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;vbcompii_topic5&quot;&gt;&lt;/a&gt;Conclusion&lt;/h2&gt;The  Microsoft .NET Framework includes extensive functionality for many  scenarios, but the open-source community has contributed a staggering  amount of additional functionality that can be wrapped and used just as  easily from Visual Basic 6. To some degree, this is nothing new. Visual  Basic 6 has always enjoyed a large community that has been generous  about providing code samples. Sometimes these have been snippets, and  sometimes they have been full libraries. However, with Visual Basic 6,  you were limited to code developed and shared by other Visual Basic 6  developers. With .NET, both Visual Basic .NET and C# developers can  contribute code that your application can use (SharpZipLib was written  in C#, but that doesn&#39;t make it any more difficult to wrap and use from  Visual Basic 6 than if it was written in Visual Basic .NET). In  addition, a tremendous number of libraries originally written in C++ and  Java have been ported to .NET. This means that you have, at your  disposal, thousands of additional libraries, many ported from libraries  that have been developed, enhanced, and used in production applications  for many years. &lt;br /&gt; As the VB Fusion article series has shown, you  can leverage everything that .NET provides while preserving your  existing investment in Visual Basic 6 code. As this article specifically  has shown, you&#39;re by no means limited to just the .NET framework and  libraries provided by Microsoft. The thriving .NET community is at your  disposal. &lt;br /&gt; &lt;br /&gt;  &lt;b&gt;About the author&lt;/b&gt; &lt;b&gt;Scott Swigart&lt;/b&gt; (&lt;a href=&quot;http://www.swigartconsulting.com/&quot;&gt;www.swigartconsulting.net&lt;/a&gt;)  spends his time consulting, authoring, and speaking about emerging and  converging technologies. Scott has worked with a wide range of  technologies over his career, beginning with Commodore 64 programming at  the age of 12, writing hardware diagnostics for UNIX systems in C++,  and building windows desktop, and Web applications. Over the years,  Scott has worked with component development, XML technologies, .NET, Web  service, and other languages, platforms, and paradigms. With this  experience, Scott has seen how technology evolves over time, and is  focused on helping organizations get the most out of the technology of  today, while preparing for the technology of tomorrow. Scott is also a  Microsoft MVP, and co-author of numerous books and articles. Scott can  be reached at &lt;a href=&quot;mailto:scott@swigartconsulting.com&quot;&gt;Scott Swigart&lt;/a&gt;.&lt;br /&gt;  &lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/444051914793721680/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/implementing-file-compression-and_14.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/444051914793721680'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/444051914793721680'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/implementing-file-compression-and_14.html' title='Implementing File Compression and Encryption in Visual Basic 6 Using the Microsoft .NET Framework, Part II: Compression'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-5614635334794047228</id><published>2017-03-14T11:24:00.002-07:00</published><updated>2017-03-14T11:24:40.700-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Implementing File Compression and Encryption in Visual Basic 6 Using the Microsoft .NET Framework, Part I: Cryptography</title><content type='html'>&lt;div class=&quot;topic&quot;&gt;        &lt;div class=&quot;lw_vs&quot;&gt;    &lt;div id=&quot;curversion&quot;&gt;      &lt;strong&gt;                Visual Studio .NET 2003             &lt;/strong&gt;    &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;vbcomppi&quot;&gt;       &lt;/a&gt;  &lt;div id=&quot;nstext&quot; valign=&quot;bottom&quot;&gt;&amp;nbsp; Scott Swigart&lt;br /&gt;Swigart Consulting LLC.&lt;br /&gt; February 2006&lt;br /&gt; Applies to:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft Visual Basic 6&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft Visual Basic .NET 2003&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft Visual Basic 2005&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft Visual Studio .NET 2003&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft Visual Studio 2005&lt;br /&gt; &lt;b&gt;Summary:&lt;/b&gt; In this two-part  article series, you&#39;ll see how you can easily add encryption and data  compression (ZIP) capabilities to existing Visual Basic 6 applications  using the .NET Framework. While encryption and compression may not seem  like related technologies, if you think about it, each one takes a set  of data and performs a transformation on it. In the case of encryption,  the data is made unreadable, and with compression, the data is made  smaller. You&#39;ll also see that both utilize many of the same underlying  technologies. (6 printed pages)&lt;br /&gt; Click &lt;a href=&quot;http://download.microsoft.com/download/b/1/a/b1a81d1a-c8f5-42b9-9e02-3be256c7cc51/Fusion_Small_Part1.msi&quot;&gt;here&lt;/a&gt; to download the code sample for this article.&lt;br /&gt; &lt;br /&gt; &lt;h4 class=&quot;dtH1&quot;&gt;Contents&lt;/h4&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719107.aspx#vbcomppi_topic1&quot;&gt;Prerequisites&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719107.aspx#vbcomppi_topic2&quot;&gt;Introduction&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719107.aspx#vbcomppi_topic3&quot;&gt;Visual Basic .NET File IO Primer&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719107.aspx#vbcomppi_topic4&quot;&gt;Visual Basic 6 Cryptography&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719107.aspx#vbcomppi_topic5&quot;&gt;Conclusion&lt;/a&gt;&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;vbcomppi_topic1&quot;&gt;&lt;/a&gt;Prerequisites&lt;/h2&gt;To use the code in this article, you will need to install Visual Studio 2005, or the free &lt;a href=&quot;https://msdn.microsoft.com/vstudio/express/vb/default.aspx&quot;&gt;Visual Basic Express&lt;/a&gt;.  These products can be installed along side of Visual Studio 6.0, Visual  Studio .NET, and/or Visual Studio 2003, without impacting those  products.&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;vbcomppi_topic2&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;I  have a secret, and I don&#39;t want you to know it. Actually, I have an  application, and I want it to be able to store information in an  encrypted format so that it can&#39;t be read by unauthorized users. Visual  Basic 6 does not have any built-in functionality to perform encryption  or decryption of data, but the Microsoft .NET Framework does have strong  encryption built it. In this article, I provide a Visual Basic .NET  component that provides encryption and decryption functionality, and you  can very easily use this component from Visual Basic 6, ASP, or any  other COM environment.&lt;br /&gt; First, it&#39;s worth reviewing how Visual  Basic 6 lets you work with files. Visual Basic 6 provides a number of  language keywords for file I/O.&lt;br /&gt; &lt;b&gt;Example 1. Reading for a file with Visual Basic 6&lt;/b&gt;&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-1&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_86f791fe-1965-4f55-acd5-79118f2fdf9e&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Dim dataIn As String&lt;br /&gt;Open someFileName For Input As #1&lt;br /&gt;Do Until Eof(1)&lt;br /&gt;    Line Input #1, dataIn&lt;br /&gt;    Debug.Print dataIn&lt;br /&gt;Loop&lt;br /&gt;Close #1&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;With Visual Basic 6, you do all your operations on a file handle (#1  in this case), and it&#39;s up to you to manage this file handle. There  isn&#39;t a single object that encapsulates the file operations; instead,  there are a number of keywords (&lt;b&gt;Open&lt;/b&gt;, &lt;b&gt;Close&lt;/b&gt;, &lt;b&gt;Input&lt;/b&gt;,  and so on). If you do want to do encryption and decryption with Visual  Basic 6, you would have to read all the data into memory, encrypt all of  it using some third party component (generating what&#39;s known as &quot;cipher  text&quot;), and then send all the cipher text to the output file. It would  be nice if you could stream the information through your program, but  this would not be easy to do.&lt;br /&gt; To facilitate really easy  encryption from Visual Basic 6, I&#39;ve created an excryption/decryption  component. Next you&#39;ll see how this component was implemented, but it&#39;s  worth mentioning that you don&#39;t need to understand any of the  implementation details to actually use the component. If you just want  to use the component without digging into how it works, just skip ahead  to &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719107.aspx#vbcomppi_topic4&quot;&gt;Visual Basic 6 Cryptography&lt;/a&gt;.&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;vbcomppi_topic3&quot;&gt;&lt;/a&gt;Visual Basic .NET File IO Primer&lt;/h2&gt;Before  jumping into encryption, it&#39;s important to understand how Visual Basic  .NET deals with file IO. The Microsoft .NET Framework uses something  known as &quot;streams&quot; when working with files, as shown here.&lt;br /&gt; &lt;b&gt;Example 2. Visual Basic .NET File IO&lt;/b&gt;&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-2&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_1c78a6b3-ceae-40e2-ab01-0aa03d6a3152&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Dim sw As New StreamWriter(&quot;C:\log.txt&quot;)&lt;br /&gt;sw.WriteLine(&quot;This is a test&quot;)&lt;br /&gt;sw.Close()&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;You can see that Visual Basic .NET provides classes specifically for  reading and writing from files (and other IO devices). In this case,  the code uses the &lt;b&gt;StreamWriter&lt;/b&gt; class to write lines of text to a file. The &lt;b&gt;StreamWriter&lt;/b&gt; object is a nice convenience, as you don&#39;t have to keep track of a file  handle, and all the operations for working with a file show up in  Intellisense. In addition to the &lt;b&gt;StreamWriter&lt;/b&gt; class, there are also these classes:&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Table 1. Classes available in Visual Basic .NET&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;tablediv&quot;&gt;&lt;div class=&quot;contentTableWrapper&quot;&gt;&lt;table class=&quot;dtTABLE&quot; summary=&quot;table&quot;&gt; &lt;tbody&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;th scope=&quot;col&quot; width=&quot;50%&quot;&gt;Class name&lt;/th&gt; &lt;th scope=&quot;col&quot; width=&quot;50%&quot;&gt;Function&lt;/th&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;Class name&quot; width=&quot;50%&quot;&gt;&lt;b&gt;FileStream&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Function&quot; width=&quot;50%&quot;&gt;Reading and writing from a binary file.&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;Class name&quot; width=&quot;50%&quot;&gt;&lt;b&gt;NetworkStream&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Function&quot; width=&quot;50%&quot;&gt;Reading and writing from a network.&lt;/td&gt; &lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt; &lt;td data-th=&quot;Class name&quot; width=&quot;50%&quot;&gt;&lt;b&gt;MemoryStream&lt;/b&gt;&lt;/td&gt; &lt;td data-th=&quot;Function&quot; width=&quot;50%&quot;&gt;Reading and writing from memory as though it were a file.&lt;/td&gt; &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;/div&gt;In actuality, the &lt;b&gt;StreamWriter&lt;/b&gt; in our code sample is internally using a &lt;b&gt;FileStream&lt;/b&gt; object to write information to the disk. The &lt;b&gt;FileStream&lt;/b&gt; lets you create, open, and append to disk files, and open them for reading and writing. However, the &lt;b&gt;FileStream&lt;/b&gt; wants to read and write blocks of data—arrays of bytes—to and from  files. When working with text, you typically want to work with lines,  not 1024 byte blocks, so the &lt;b&gt;StreamWriter&lt;/b&gt; stacks on top of the &lt;b&gt;FileStream&lt;/b&gt; to provide the &lt;b&gt;WriteLine&lt;/b&gt; functionality. You could also stack the &lt;b&gt;StreamWriter&lt;/b&gt; or &lt;b&gt;StreamReader&lt;/b&gt; on top of a &lt;b&gt;NetworkStream&lt;/b&gt; or &lt;b&gt;MemoryStream&lt;/b&gt; so that you could &lt;b&gt;WriteLine&lt;/b&gt; or &lt;b&gt;ReadLine&lt;/b&gt; from those devices as well.&lt;br /&gt; This  is really the strength of streams. You can stack one stream on top of  another to plug in additional functionality. In fact, this is how  encryption works in Visual Basic .NET. The &lt;b&gt;CryptoStream&lt;/b&gt; is added to the stack, and all the data that passes through it is encrypted or decrypted:&lt;br /&gt; &lt;b&gt;Example 3. Stacking streams to enable encryption with Visual Basic.NET&lt;/b&gt;&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-3&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_3a1009e3-175d-4aee-ad1a-f75f2bfdec72&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;fs = New FileStream(fileName, FileMode.Create, FileAccess.Write)&lt;br /&gt;cs = New CryptoStream(fs, rc2.CreateEncryptor(), CryptoStreamMode.Write)&lt;br /&gt;sw = New StreamWriter(cs)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Here, a &lt;b&gt;FileStream&lt;/b&gt; class is created to enable writing to a specific disk file. A &lt;b&gt;CryptoStream&lt;/b&gt; is stacked on top of the &lt;b&gt;FileStream&lt;/b&gt; so that information is encrypted before it&#39;s sent to the &lt;b&gt;FileStream&lt;/b&gt;. The &lt;b&gt;StreamWriter&lt;/b&gt; is then stacked on top of the &lt;b&gt;CryptoStream&lt;/b&gt; so that you have convenient &lt;b&gt;WriteLine&lt;/b&gt; functionality, rather than having to work with fixed length blocks of data.&lt;br /&gt; The &lt;b&gt;CryptoStream&lt;/b&gt; is what does the magic of encryption. It supports many encryption  algorithms, and so it needs to be configured with some initial  information before it&#39;s used. For this component, the &lt;a href=&quot;http://en.wikipedia.org/wiki/RC2&quot;&gt;RC2&lt;/a&gt; encryption algorithm was used, as it provides strong, fast encryption. However, if you want to use &lt;a href=&quot;http://en.wikipedia.org/wiki/Data_Encryption_Standard&quot;&gt;DES&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Triple_DES&quot;&gt;Triple-DES&lt;/a&gt;, or &lt;a href=&quot;http://en.wikipedia.org/wiki/Advanced_Encryption_Standard&quot;&gt;Rijndael&lt;/a&gt; encryption, this code can be modified to use those instead.&lt;br /&gt; &lt;b&gt;Example 4. Configuring RC2 Encryption with Visual Basic.NET&lt;/b&gt;&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-4&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_431bda3d-f8af-4f3b-abb4-cd8f38fbec57&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Dim rc2 As New RC2CryptoServiceProvider&lt;br /&gt;rc2.IV = IV&lt;br /&gt;&lt;br /&gt;Dim pdb As New PasswordDeriveBytes(password, Nothing)&lt;br /&gt;rc2.Key = pdb.CryptDeriveKey(&quot;RC2&quot;, &quot;SHA1&quot;, 128, IV)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Symmetric cryptography is based on using a secret key to encrypt the  information. In this case, the key will be supplied to this algorithm  in the form of a password. From the password, a cryptographic key is  derived using the &lt;b&gt;PasswordDeriveBytes&lt;/b&gt; class. For additional  security, an initialization vector can be used (IV). An IV is used to  insure that, if a document contains identical sections of plain text,  the document doesn&#39;t encrypt to identical cipher text. This also makes  the key more secure if multiple files are encrypted using the same key.  When you use this component, specifying an IV is optional.&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;vbcomppi_topic4&quot;&gt;&lt;/a&gt;Visual Basic 6 Cryptography&lt;/h2&gt;Again,  while the basics of cryptography are being covered here, you don&#39;t need  to know anything about .NET or cryptography to use this component. From  Visual Basic 6, using this component is as simple as this.&lt;br /&gt; &lt;b&gt;Example 5. Using the cryptography component from Visual Basic 6&lt;/b&gt;&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-5&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_1b9ff3bc-fe15-4555-a4ef-8c31967becc8&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Dim e As wrappers.EncryptedFileWriterWrapper&lt;br /&gt;Set e = New wrappers.EncryptedFileWriterWrapper&lt;br /&gt;    &lt;br /&gt;e.Open &quot;c:\file.bin&quot;, txtPassword, False, &quot;&quot;&lt;br /&gt;e.WriteLine (txtMessage)&lt;br /&gt;e.Close&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;You can see that once the &lt;b&gt;EncryptedFileWriterWrapper&lt;/b&gt; has been  created, it&#39;s trivial to use. You just create an instance of it, give  it a file name and password, and start writing data. The data will be  encrypted and written to the file.&lt;br /&gt; &lt;div class=&quot;fig&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC93640.gif&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 1. Attempting to view encrypted data with Notepad&lt;/b&gt;&lt;/div&gt;Reading and decrypting the data is equally simple.&lt;br /&gt; &lt;b&gt;Example 6. Reading and decrypting data using Visual Basic 6&lt;/b&gt;&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-6&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_d785bcb9-46c2-4486-a307-c1951a41a8cf&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Dim e As wrappers.EncryptedFileReaderWrapper&lt;br /&gt;Set e = New EncryptedFileReaderWrapper&lt;br /&gt;&lt;br /&gt;e.Open &quot;c:\file.bin&quot;, txtPassword, &quot;&quot;&lt;br /&gt;While Not e.EOF&lt;br /&gt;    txtMessage = txtMessage &amp;amp; e.ReadLine &amp;amp; vbCrLf&lt;br /&gt;Wend&lt;br /&gt;e.Close&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Again, you just specify a file name and password, and start reading.  The data is decrypted by the component and returned as simple text.&lt;br /&gt; For  your convenience, I&#39;ve put together a Visual Basic 6 application that  uses the component to perform encryption and decryption. To use this  component, you may need to do a couple of things.  &lt;br /&gt;&lt;ol type=&quot;1&quot;&gt;&lt;li&gt;Download and install the &lt;a href=&quot;https://www.microsoft.com/downloads/details.aspx?FamilyID=fe6f2099-b7b4-4f47-a244-c96d69c35dec&amp;amp;DisplayLang=en&quot;&gt;Microsoft .NET Framework SDK 2.0&lt;/a&gt; (if you have Visual Studio .NET 2005 or Visual Basic Express installed, you can skip this step). &lt;/li&gt;&lt;li&gt;Download the code associated with this article. &lt;/li&gt;&lt;li&gt;Execute  the &quot;Install.bat&quot; file included with the code for this article. This  registers the encryption component so that you can use it from your  Visual Basic 6 application. &lt;/li&gt;&lt;li&gt;In the code for this article, open the Visual Basic 6 project in the &quot;Encryption&quot; folder. &lt;/li&gt;&lt;li&gt;Press F5 to run the sample application: &lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC52774.gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 2. Sample application for encryption and decryption&lt;/b&gt; &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;Enter any string for the password and click &lt;b&gt;Save&lt;/b&gt;.  The text is saved to &quot;c:\file.bin.&quot; If you open this file in Notepad,  you will see that it&#39;s encrypted. The textbox is also cleared. &lt;br /&gt; If you click on &lt;b&gt;Load&lt;/b&gt;,  the information will be retrieved, decrypted, and displayed in the text  box. If you change the password so that it doesn&#39;t match the password  that the text was saved with, you will see that the file is not  decrypted.&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;vbcomppi_topic5&quot;&gt;&lt;/a&gt;Conclusion&lt;/h2&gt;Visual  Basic 6 doesn&#39;t provide built in encryption and decryption  functionality, but the Microsoft .NET Framework does. As with everything  in the .NET Framework, it is relatively simple to expose that  functionality so that it can be used from a Visual Basic 6 application.  This article provides you with a pre-packaged solution to add encryption  and decryption functionality to your Visual Basic 6 application with  just a few lines of code. Enjoy.&lt;br /&gt; &lt;br /&gt;  &lt;b&gt;About the author&lt;/b&gt; &lt;b&gt;Scott Swigart&lt;/b&gt; (&lt;a href=&quot;http://www.swigartconsulting.com/&quot;&gt;www.swigartconsulting.net&lt;/a&gt;)  spends his time consulting, authoring, and speaking about emerging and  converging technologies. Scott has worked with a wide range of  technologies over his career, beginning with Commodore 64 programming at  the age of 12, writing hardware diagnostics for UNIX systems in C++,  and building windows desktop, and Web applications. Over the years,  Scott has worked with component development, XML technologies, .NET, Web  service, and other languages, platforms, and paradigms. With this  experience, Scott has seen how technology evolves over time, and is  focused on helping organizations get the most out of the technology of  today, while preparing for the technology of tomorrow. Scott is also a  Microsoft MVP, and co-author of numerous books and articles. Scott can  be reached at &lt;a href=&quot;mailto:scott@swigartconsulting.com&quot;&gt;Scott Swigart&lt;/a&gt;.&lt;br /&gt;  &lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/5614635334794047228/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/implementing-file-compression-and.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/5614635334794047228'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/5614635334794047228'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/implementing-file-compression-and.html' title='Implementing File Compression and Encryption in Visual Basic 6 Using the Microsoft .NET Framework, Part I: Cryptography'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-1151674850519681167</id><published>2017-03-14T11:22:00.002-07:00</published><updated>2017-03-14T11:22:15.028-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Using Background Threads with Visual Basic 6</title><content type='html'>&lt;div class=&quot;topic&quot;&gt;        &lt;div class=&quot;lw_vs&quot;&gt;    &lt;div id=&quot;curversion&quot;&gt;      &lt;strong&gt;                Visual Studio .NET 2003             &lt;/strong&gt;    &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;vbfusionbt&quot;&gt;       &lt;/a&gt;  &lt;div id=&quot;nstext&quot; valign=&quot;bottom&quot;&gt;&amp;nbsp; Scott Swigart&lt;br /&gt;Swigart Consulting LLC.&lt;br /&gt; March 2006&lt;br /&gt; Applies to:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft Visual Basic 6&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft Visual Basic 2005&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft Visual Studio 2005&lt;br /&gt; &lt;b&gt;Summary:&lt;/b&gt; Learn how to use  the .NET Framework 2.0 BackgroundWorker component from Visual Basic 6  applications to perform long running operations on background threads.  This article shows you how to inform the user of progress, how to allow  the user to cancel the background task, and how to debug multi-threaded  applications. (10 printed pages) &lt;br /&gt; Click &lt;a href=&quot;http://download.microsoft.com/download/6/4/1/64162c52-49e0-4bfb-b89c-9783ec05bef0/fusion_background_threads.msi&quot;&gt;here&lt;/a&gt; to download the code sample for this article.&lt;br /&gt; &lt;br /&gt; &lt;h4 class=&quot;dtH1&quot;&gt;Contents&lt;/h4&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719109.aspx#vbfusionbt_topic1&quot;&gt;Overview&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719109.aspx#vbfusionbt_topic2&quot;&gt;Getting Started with the Article Sample Code&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719109.aspx#vbfusionbt_topic3&quot;&gt;Using the BackgroundWorker&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719109.aspx#vbfusionbt_topic4&quot;&gt;Canceling Background Tasks&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719109.aspx#vbfusionbt_topic5&quot;&gt;Implementing Progress Notifications&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719109.aspx#vbfusionbt_topic6&quot;&gt;Debugging Considerations&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719109.aspx#vbfusionbt_topic7&quot;&gt;Conclusion&lt;/a&gt;&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;vbfusionbt_topic1&quot;&gt;&lt;/a&gt;Overview&lt;/h2&gt;Applications  can stop responding during long running operations, resulting in  dissatisfied users. The traditional Visual Basic 6 technique to keep the  application responding during a long running operation is to call &lt;b&gt;DoEvents&lt;/b&gt; repeatedly. This allows the application to respond to events, and  prevents the impression that the application has locked up. To provide a  smooth user experience, &lt;b&gt;DoEvents&lt;/b&gt; must be called several times a  second. Sometimes, this simply isn&#39;t possible. If you execute a long  running SQL statement, or are blocked waiting on an external resource,  you do not have the ability to call &lt;b&gt;DoEvents&lt;/b&gt; throughout the operation, and so the application appears to hang.&lt;br /&gt; An  advanced programming technique for handling long running operations is  to perform the operation on a background thread. However, Visual Basic 6  does not support developing multi-threaded applications, and does not  provide any built-in mechanism for starting background threads. However,  Visual Basic .NET does support multi-threaded development, and Visual  Studio 2005 includes a &lt;b&gt;BackgroundWorker&lt;/b&gt; component that makes it  easy to put operations on a background thread. This lets your  application remain responsive while the operation progresses.&lt;br /&gt; Normally, the &lt;b&gt;BackgroundWorker&lt;/b&gt; component would only be available to .NET applications. However, this article includes a COM wrapper for the &lt;b&gt;BackgroundWorker&lt;/b&gt; component so that it can be used seamlessly from COM environments, such as Visual Basic 6. &lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;vbfusionbt_topic2&quot;&gt;&lt;/a&gt;Getting Started with the Article Sample Code&lt;/h2&gt;Included  in this article is a sample application that performs work in a  background thread. To start using the sample, download and extract the  code, and navigate into the &quot;VS 2005 NetFX20Wrapper&quot; folder. Open the  solution file (.sln) with Visual Studio 2005. If you do not have Visual  Studio 2005, you can download the free Visual Basic Express from &lt;a href=&quot;http://lab.msdn.microsoft.com/express/vbasic/default.aspx&quot;&gt;http://lab.msdn.microsoft.com/express/vbasic/default.aspx&lt;/a&gt;,  and use it instead. In fact, Visual Basic Express is a great way to try  out many of the features of Visual Studio 2005, with no cost. &lt;br /&gt; Once you have the solution open, select the &lt;b&gt;Build | Build Solution&lt;/b&gt; menu command to compile the Visual Basic .NET wrapper that makes the &lt;b&gt;BackgroundWorker&lt;/b&gt; component available as a COM object. You can then navigate to the &quot;VB6  Application&quot; folder and open the Visual Basic 6 sample application. When  you run the application, it will perform a long running operation in  the background, displaying the progress as the operation executes:&lt;br /&gt; &lt;div class=&quot;fig&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC135557.gif&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 1. Sample application performing a long running operation&lt;/b&gt;&lt;/div&gt;The application also gives you the ability to cancel the background operation. Next you will see how you can use the &lt;b&gt;BackgroundWorker&lt;/b&gt; component from your own applications.&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;vbfusionbt_topic3&quot;&gt;&lt;/a&gt;Using the BackgroundWorker&lt;/h2&gt;As the following walk-through will show, you can reference the &lt;b&gt;BackgroundWorker&lt;/b&gt; component as though it were any simple COM object. &lt;b&gt;BackgroundWorker&lt;/b&gt; exposes functions that let you start and stop the background operation. &lt;b&gt;BackgroundWorker&lt;/b&gt; also exposes events to let you know how the work is progressing, and when it has completed. &lt;br /&gt; &lt;b&gt;Walkthrough: Setting up background work&lt;/b&gt; &lt;br /&gt;&lt;ol type=&quot;1&quot;&gt;&lt;li&gt;Open &lt;b&gt;Visual Basic 6.0&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;In the &lt;b&gt;New Project&lt;/b&gt; dialog, select &lt;b&gt;Standard EXE&lt;/b&gt;, and click &lt;b&gt;Open&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Select the &lt;b&gt;Project | References&lt;/b&gt; menu command.&lt;/li&gt;&lt;li&gt;Check &lt;b&gt;NetFx20Wrapper&lt;/b&gt;, and click &lt;b&gt;OK&lt;/b&gt;. This adds a reference to the wrapper for the &lt;b&gt;BackgroundWorker&lt;/b&gt; component, allowing you to use &lt;b&gt;BackgroundWorker&lt;/b&gt; from Visual Basic 6. &lt;/li&gt;&lt;li&gt;Select the &lt;b&gt;Project | Add Module &lt;/b&gt;menu command.&lt;/li&gt;&lt;li&gt;In the &lt;b&gt;Add Module &lt;/b&gt;dialog, click &lt;b&gt;Open&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;In the &lt;b&gt;Code Editor&lt;/b&gt;, insert the following code:  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-1&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_29348941-e818-4518-847f-02ec12a8a47e&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Private Declare Sub Sleep Lib &quot;kernel32&quot; (ByVal dwMilliseconds As Long)&lt;br /&gt;Public backgroundWorker As NetFX20Wrapper.BackgroundWorkerWrapper&lt;br /&gt;&lt;br /&gt;Public Sub BackgroundWork(ByRef argument As Variant, _&lt;br /&gt;    ByRef e As NetFX20Wrapper.RunWorkerCompletedEventArgsWrapper)&lt;br /&gt;On Error GoTo eh&lt;br /&gt;    Sleep argument&lt;br /&gt;    e.SetResult &quot;Background work done&quot;&lt;br /&gt;    Exit Sub&lt;br /&gt;    &lt;br /&gt;eh:&lt;br /&gt;    e.Error.Number = Err.Number&lt;br /&gt;    e.Error.Description = Err.Description&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;The &lt;b&gt;BackgroundWorker&lt;/b&gt; component will be used to  run this subroutine on a background thread. The subroutine simply sleeps  for a specified number of milliseconds and returns, to simulate a long  running operation. This subroutine is also passed a &lt;b&gt;RunWorkerCompletedEventArgsWrapper&lt;/b&gt; argument. This argument lets the subroutine indicate whether it was  successful or not, and returns a result. If the subroutine completes  without error, it will use e.Result to pass a return value back to the  main thread. If it fails, the error handler will set error information  that is passed back to the main thread. It is critical that the  background thread does not have any unhandled errors. &lt;i&gt;If any errors go unhandled in the background thread, the application will crash&lt;/i&gt;.  For this reason, you always must set up an On Error Goto in your  background subroutine, and use e.Error to return error information.&lt;br /&gt; &lt;b&gt;Walkthrough: Starting the background work&lt;/b&gt; &lt;br /&gt;&lt;ol type=&quot;1&quot;&gt;&lt;li&gt;In the &lt;b&gt;Project Explorer&lt;/b&gt;, double-click &lt;b&gt;Form1&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Add a &lt;b&gt;button&lt;/b&gt; to the form and set its caption to &lt;b&gt;Start&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Double-click the button to create the event handler.&lt;/li&gt;&lt;li&gt;Replace the code in the code editor with the following:  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-2&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_10c38580-716a-43c7-aed9-2f012ca137f4&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Dim WithEvents background As NetFX20Wrapper.BackgroundWorkerWrapper&lt;br /&gt;&lt;br /&gt;Private Sub Form_Load()&lt;br /&gt;    Set background = New NetFX20Wrapper.BackgroundWorkerWrapper&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Private Sub Command1_Click()&lt;br /&gt;    set module1.backgroundWorker = background&lt;br /&gt;    background.RunWorkerAsync AddressOf BackgroundWork, 5000&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This creates an instance of the &lt;b&gt;BackgroundWorker&lt;/b&gt; component. When the button is clicked, &lt;b&gt;BackgroundWorker&lt;/b&gt; is used to start the &lt;b&gt;BackgroundWork&lt;/b&gt; subroutine (created in the previous walkthrough) on a background thread. Also notice that an argument of &lt;b&gt;5000&lt;/b&gt; will be passed to the subroutine. This is used inside of the subroutine to determine the number of milliseconds to sleep. &lt;/li&gt;&lt;li&gt;In the &lt;b&gt;Object &lt;/b&gt;drop-down menu, select &lt;b&gt;background&lt;/b&gt;. In the &lt;b&gt;Procedure&lt;/b&gt; drop-down menu, select &lt;b&gt;RunWorkerCompleted&lt;/b&gt;. This will create an event handler that fires when the background work has finished. &lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC97492.gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 2. Create the event handler here&lt;/b&gt; &lt;/div&gt;&lt;/li&gt;&lt;li&gt;Code the &lt;b&gt;RunWorkerCompleted&lt;/b&gt; event handler as follows:  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-3&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_4197941c-9c70-413d-a88e-b513d77bd68d&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Private Sub background_RunWorkerCompleted(ByVal sender As Variant, _&lt;br /&gt;    ByVal e As NetFX20Wrapper.RunWorkerCompletedEventArgsWrapper)&lt;br /&gt;    &lt;br /&gt;    If e.Error.Number = 0 Then&lt;br /&gt;        MsgBox e.GetResult&lt;br /&gt;    Else&lt;br /&gt;        MsgBox e.Error.Description&lt;br /&gt;    End If&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This will check to see if the background work completed without  error. If so, the return value from the background work will be  displayed. Otherwise, an error message will be displayed. &lt;/li&gt;&lt;li&gt;Select the &lt;b&gt;Tools | Options &lt;/b&gt;menu command.&lt;/li&gt;&lt;li&gt;Select the &lt;b&gt;Environment&lt;/b&gt; tab.&lt;/li&gt;&lt;li&gt;In the &lt;b&gt;When a program starts&lt;/b&gt; group box, select &lt;b&gt;Save Changes&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;OK&lt;/b&gt;. It&#39;s very important to save changes every time the application runs.  If errors happen in the background subroutine, it can crash the  development environment. If you don&#39;t save changes, this can result in a  loss of work. &lt;/li&gt;&lt;li&gt;Press &lt;b&gt;F5&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Select a folder to save all project files.&lt;/li&gt;&lt;li&gt;The application starts: &lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC75231.gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 3. Application with Start button to begin the background operation&lt;/b&gt; &lt;/div&gt;&lt;/li&gt;&lt;li&gt;Click the &lt;b&gt;Start&lt;/b&gt; button. This starts the background operation, which will run for 5 seconds.&lt;/li&gt;&lt;li&gt;Drag the form around to prove that the application is not blocked while the background subroutine is running.&lt;/li&gt;&lt;li&gt;After  five seconds, a message box is displayed indicating that the background  subroutine completed. The message box contains a string returned from  the background subroutine. &lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC75784.gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 4. Background work completed message box&lt;/b&gt; &lt;/div&gt;&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;OK&lt;/b&gt;, and close the application.&lt;/li&gt;&lt;/ol&gt;&lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;vbfusionbt_topic4&quot;&gt;&lt;/a&gt;Canceling Background Tasks&lt;/h2&gt;With the BackgroundWorker, you can also &lt;i&gt;request&lt;/i&gt; that the background subroutine abort. I say request, because your  background subroutine must periodically poll a property to see if a  cancellation has been requested, and abort if so. In the walkthrough  shown previously, the background subroutine calls Sleep, and the  background subroutine isn&#39;t able to do anything else until Sleep  returns, five seconds later. For this reason, the background subroutine  would not be able to abort if a cancel request was sent, because it  would not be able to process that cancel request until it was already  finished processing.&lt;br /&gt; For a background thread to be able to  respond to a cancel request, it must be doing its work in discrete  chunks, with the ability to check for a cancellation request between  chunks. If you&#39;re making a call to a long running stored procedure, or  otherwise waiting on an external resource, then the &lt;b&gt;BackgroundWorker&lt;/b&gt; component is still very useful, as it allows you to put that operation  in the background and keep the application responsive, but you will not  be able to give the user the option to abort the operation once it  begins.&lt;br /&gt; For the purposes of demonstration, the background work in  the walkthrough can be broken into smaller chunks so that you can see  how cancel functionality is implemented.&lt;br /&gt; &lt;b&gt;Walkthrough: Canceling background operations&lt;/b&gt; &lt;br /&gt;&lt;ol type=&quot;1&quot;&gt;&lt;li&gt;In the &lt;b&gt;Project Explorer&lt;/b&gt;, double-click &lt;b&gt;Module1&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Modify the &lt;b&gt;BackgroundWork&lt;/b&gt; subroutine as follows:  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-4&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_6d9671ed-4daa-4de9-b959-55eb7b7ea417&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Public Sub BackgroundWork(ByRef argument As Variant, _&lt;br /&gt;    ByRef e As NetFX20Wrapper.RunWorkerCompletedEventArgsWrapper)&lt;br /&gt;On Error GoTo eh&lt;br /&gt;    For i = 1 To argument / 500&lt;br /&gt;        Sleep 500&lt;br /&gt;        If backgroundWorker.CancellationPending Then&lt;br /&gt;            e.SetResult &quot;Cancelled after &quot; &amp;amp; i * 500 &amp;amp; &quot; ms&quot;&lt;br /&gt;            e.Cancelled = True&lt;br /&gt;            Exit Sub&lt;br /&gt;        End If&lt;br /&gt;    Next&lt;br /&gt;    e.SetResult &quot;Background work done&quot;&lt;br /&gt;    Exit Sub&lt;br /&gt;    &lt;br /&gt;eh:&lt;br /&gt;    e.Error.Number = Err.Number&lt;br /&gt;    e.Error.Description = Err.Description&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This code has been modified so that the work is broken into 500  millisecond chunks. After each 500 millisecond unit of work the code  checks the &lt;b&gt;CancellationPending&lt;/b&gt; property of the &lt;b&gt;BackgroundWorker&lt;/b&gt; component. If &lt;b&gt;CancellationPending&lt;/b&gt; is true, then the routine sets the &lt;b&gt;Cancelled&lt;/b&gt; property to &lt;b&gt;true&lt;/b&gt;.  This will let the main thread determine if the background work ran to  completion, or if it was successfully cancelled. The background  subroutine also sets the result message, and then exits. &lt;/li&gt;&lt;li&gt;In the &lt;b&gt;Project Explorer&lt;/b&gt;, double-click &lt;b&gt;Form1&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Add another &lt;b&gt;button&lt;/b&gt; to the form, and set its caption to &lt;b&gt;Cancel&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Double-click the button to create its &lt;b&gt;Click&lt;/b&gt; event handler.&lt;/li&gt;&lt;li&gt;Code the &lt;b&gt;Click&lt;/b&gt; event handler as follows:  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-5&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_f671423d-9cd3-4210-8ea2-f760a741393d&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Private Sub Command2_Click()&lt;br /&gt;    background.CancelAsync&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;In the &lt;b&gt;Project Explorer&lt;/b&gt;, right-click &lt;b&gt;Form1&lt;/b&gt;, and select &lt;b&gt;View Code&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Modify &lt;b&gt;background_RunWorkerCompleted&lt;/b&gt; as follows:  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-6&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_a7fe57f2-d1fa-409b-93d3-62bb3ff260a1&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    If e.Cancelled Then&lt;br /&gt;        MsgBox &quot;Cancelled: &quot; &amp;amp; e.GetResult&lt;br /&gt;    ElseIf e.Error.Number = 0 Then&lt;br /&gt;        MsgBox e.GetResult&lt;br /&gt;    Else&lt;br /&gt;        MsgBox e.Error.Description&lt;br /&gt;    End If&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This routine can now check the &lt;b&gt;Cancelled&lt;/b&gt; property to see if the background subroutine ran to completion, or was cancelled prematurely.  &lt;/li&gt;&lt;li&gt;Press &lt;b&gt;F5 &lt;/b&gt;to run the application.&lt;/li&gt;&lt;li&gt;Click the &lt;b&gt;Start&lt;/b&gt; button, and then click the &lt;b&gt;Cancel&lt;/b&gt; button. You should see a message like the following: &lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC122371.gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 5. Message box indicating cancellation of the background task&lt;/b&gt; &lt;/div&gt;&lt;/li&gt;&lt;li&gt;Click &lt;b&gt;OK&lt;/b&gt;, and close the application.&lt;/li&gt;&lt;/ol&gt;&lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;vbfusionbt_topic5&quot;&gt;&lt;/a&gt;Implementing Progress Notifications&lt;/h2&gt;The &lt;b&gt;BackgroundWorker&lt;/b&gt; component also provides facilities so that the background subroutine  can send progress events to the main thread. This is useful if you want  to display a progress bar while the background subroutine runs.&lt;br /&gt; &lt;b&gt;Walkthrough: Adding progress support&lt;/b&gt; &lt;br /&gt;&lt;ol type=&quot;1&quot;&gt;&lt;li&gt;In the Project Explorer, double-click &lt;b&gt;Module1&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Add a call to &lt;b&gt;BackgroundWorker.ReportProgress&lt;/b&gt; as shown below:  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-7&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_583a4313-43c6-4098-acb3-cd949d69860f&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Public Sub BackgroundWork(ByRef argument As Variant, _&lt;br /&gt;    ByRef e As NetFX20Wrapper.RunWorkerCompletedEventArgsWrapper)&lt;br /&gt;On Error GoTo eh&lt;br /&gt;    For i = 1 To argument / 500&lt;br /&gt;        Sleep 500&lt;br /&gt;        If backgroundWorker.CancellationPending Then&lt;br /&gt;            e.SetResult &quot;Cancelled after &quot; &amp;amp; i * 500 &amp;amp; &quot; ms&quot;&lt;br /&gt;            e.Cancelled = True&lt;br /&gt;            Exit Sub&lt;br /&gt;        End If&lt;br /&gt;        backgroundWorker.ReportProgress _&lt;br /&gt;            (CDbl(i) / (argument / 500)) * 100&lt;br /&gt;    Next&lt;br /&gt;    e.SetResult &quot;Background work done&quot;&lt;br /&gt;    Exit Sub&lt;br /&gt;    &lt;br /&gt;eh:&lt;br /&gt;    e.Error.Number = Err.Number&lt;br /&gt;    e.Error.Description = Err.Description&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This sends a value from 0 to 100 indicating what percentage of the work has been completed. &lt;/li&gt;&lt;li&gt;In the &lt;b&gt;Project Explorer&lt;/b&gt;, double-click &lt;b&gt;Form1&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Right-click the &lt;b&gt;Toolbar&lt;/b&gt;, and select &lt;b&gt;Components&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Check &lt;b&gt;Microsoft Windows Common Controls 6.0&lt;/b&gt;, and click &lt;b&gt;OK&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Add a &lt;b&gt;ProgressBar &lt;/b&gt;control to the form.&lt;/li&gt;&lt;li&gt;Press &lt;b&gt;F7&lt;/b&gt; to switch to &lt;b&gt;code view&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;In the &lt;b&gt;Object&lt;/b&gt; drop-down, select &lt;b&gt;background&lt;/b&gt;. In the &lt;b&gt;Procedure&lt;/b&gt; drop-down, select &lt;b&gt;ProgressChanged&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Code the &lt;b&gt;ProgressChanged&lt;/b&gt; event handler as follows:  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-8&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_013e6679-c6b7-48be-b810-df84274a92df&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Private Sub background_ProgressChanged(ByVal sender As Variant, _&lt;br /&gt;    ByVal e As NetFX20Wrapper.ProgressChangedEventArgsWrapper)&lt;br /&gt;&lt;br /&gt;    ProgressBar1 = e.ProgressPercentage&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;When the background subroutine calls &lt;b&gt;ReportProgress&lt;/b&gt;, it causes the &lt;b&gt;ProgressChanged&lt;/b&gt; event to fire on the main thread. In this event, you can look at the &lt;b&gt;ProgressPercentage&lt;/b&gt; property to determine how much of the work has been done. &lt;/li&gt;&lt;li&gt;Press &lt;b&gt;F5&lt;/b&gt; to run the application.  &lt;/li&gt;&lt;li&gt;Click &lt;b&gt;Start&lt;/b&gt;. You should see the progress bar move as the background subroutine does work. &lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC82113.gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 6. Progress bar display&lt;/b&gt; &lt;/div&gt;&lt;/li&gt;&lt;li&gt;Close the application.&lt;/li&gt;&lt;/ol&gt;&lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;vbfusionbt_topic6&quot;&gt;&lt;/a&gt;Debugging Considerations&lt;/h2&gt;The  Visual Basic 6 development environment was not designed to support  debugging multi-threaded applications. For this reason, you cannot set a  breakpoint in your background subroutine. If you do, the development  environment will crash. Also, if your background subroutine has an  unhandled exception, the development environment will also crash.  &lt;br /&gt; To facilitate debugging, the wrapper for the &lt;b&gt;BackgroundWorker&lt;/b&gt; exposes a &lt;b&gt;RunWorkerSync&lt;/b&gt; function. This works exactly like &lt;b&gt;RunWorkerAsync&lt;/b&gt;,  except the background subroutine is run on the main thread, instead of a  background thread. This means that while the subroutine is running,  your application will appear to lock up. However, this does allow you to  safely set breakpoints in your background routine, and perform  debugging.&lt;br /&gt; &lt;b&gt;Walkthrough: Debugging the background routine&lt;/b&gt; &lt;br /&gt;&lt;ol type=&quot;1&quot;&gt;&lt;li&gt;In the Project Explorer, right-click &lt;b&gt;Form1&lt;/b&gt;, and select &lt;b&gt;View Code&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Modify the &lt;b&gt;Button1_Click&lt;/b&gt; event as follows:  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-9&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_6184268b-627e-4cb4-9974-c69b6b59dab5&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Private Sub Command1_Click()&lt;br /&gt;    Set Module1.backgroundWorker = background&lt;br /&gt;    background.RunWorkerSync AddressOf BackgroundWork, 5000&lt;br /&gt;End Sub &lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Changing the call from &lt;b&gt;RunWorkerAsync&lt;/b&gt; to &lt;b&gt;RunWorkerSync&lt;/b&gt; will cause the background subroutine to run synchronously (on the main thread), so that it can be debugged. &lt;/li&gt;&lt;li&gt;In the &lt;b&gt;Project Explorer&lt;/b&gt;, double-click &lt;b&gt;Module1&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Set a breakpoint on the following line of code inside the &lt;b&gt;BackgroundWork&lt;/b&gt; subroutine:  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-10&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_034619bc-0f6e-424b-8b69-8e225ce778f3&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;For i = 1 To argument / 500&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;Press &lt;b&gt;F5&lt;/b&gt; to run the application.&lt;/li&gt;&lt;li&gt;Click on &lt;b&gt;Start&lt;/b&gt;. Execution stops on the breakpoint, and you can debug without error. &lt;/li&gt;&lt;li&gt;Clear the breakpoint, and press &lt;b&gt;F5&lt;/b&gt;. Execution continues, but the application is not responsive until the &lt;b&gt;BackgroundWork&lt;/b&gt; subroutine completes.&lt;/li&gt;&lt;/ol&gt;&lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;vbfusionbt_topic7&quot;&gt;&lt;/a&gt;Conclusion&lt;/h2&gt;In this article, you have seen how the &lt;b&gt;BackgroundWorked&lt;/b&gt; component from version 2.0 of the .NET Framework has been wrapped so  that it can be used seamlessly from a Visual Basic 6 (or other COM  based) application. This lets you perform long running operations on a  background thread so that the application remains responsive, and does  not appear to lock up or hang. The &lt;b&gt;BackgroundWorker&lt;/b&gt; provides  capabilities for aborting the background operation, and the background  operation can provide events to the main thread, notifying it of the  percentage completed.&lt;br /&gt; &lt;br /&gt;  &lt;b&gt;About the author&lt;/b&gt; Scott Swigart &lt;a href=&quot;http://www.swigartconsulting.com/&quot;&gt;www.swigartconsulting.net&lt;/a&gt;,  spends his time consulting with companies on how to best use today&#39;s  technology and prepare for tomorrows. Along this theme, Scott is a proud  contributor to the Visual Basic Fusion site, as it offers information  and tactics of real use for Visual Basic developers who want to build  the most functionality with the least effort. Scott is also a Microsoft  MVP, and co-author of numerous books and articles. If you have any  question or comments about this article, feel free to send e-mail to &lt;a href=&quot;mailto:scott@swigartconsulting.com&quot;&gt;scott@swigartconsulting.com&lt;/a&gt;.&lt;br /&gt;  &lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/1151674850519681167/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/using-background-threads-with-visual.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/1151674850519681167'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/1151674850519681167'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/using-background-threads-with-visual.html' title='Using Background Threads with Visual Basic 6'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-1768933577089187411</id><published>2017-03-14T11:19:00.001-07:00</published><updated>2017-03-14T11:19:10.492-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Diagnose This: Launching and Controlling System Processes with Visual Basic 6 and the .NET Framework</title><content type='html'>&lt;div class=&quot;topic&quot;&gt;        &lt;div class=&quot;lw_vs&quot;&gt;    &lt;div id=&quot;curversion&quot;&gt;      &lt;strong&gt;                Visual Studio .NET 2003             &lt;/strong&gt;    &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;diagnosethis&quot;&gt;       &lt;/a&gt;  &lt;div id=&quot;nstext&quot; valign=&quot;bottom&quot;&gt;&amp;nbsp; Scott Swigart&lt;br /&gt;Swigart Consulting LLC&lt;br /&gt; April 2006&lt;br /&gt; Applies to:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Visual Basic 6&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;.NET Framework&lt;br /&gt; &lt;b&gt;Summary:&lt;/b&gt; This article explains how to use the &lt;b&gt;Process&lt;/b&gt; class (in the &lt;b&gt;System.Diagnostics&lt;/b&gt; section of the .NET Framework Class Library) from a Visual Basic 6  application, to launch and control system processes. (10 printed pages)&lt;br /&gt; &lt;h4 class=&quot;dtH1&quot;&gt;Contents&lt;/h4&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719098.aspx#diagnosethis_topic1&quot;&gt;Introduction&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719098.aspx#diagnosethis_topic2&quot;&gt;Tom, I Can Write That App in One Line of Code&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719098.aspx#diagnosethis_topic3&quot;&gt;Using the Process Class from Visual Basic 6&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719098.aspx#diagnosethis_topic4&quot;&gt;Your Very Own Task Manager&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719098.aspx#diagnosethis_topic5&quot;&gt;Running the Sample&lt;/a&gt;&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719098.aspx#diagnosethis_topic6&quot;&gt;Conclusion&lt;/a&gt;&lt;br /&gt; Click &lt;a href=&quot;http://download.microsoft.com/download/5/3/8/53838516-a8d1-4bb0-8cde-23c8e57765c7/DiagnoseThis.msi&quot;&gt;here&lt;/a&gt; to download the code sample for this article.&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;diagnosethis_topic1&quot;&gt;&lt;/a&gt;Introduction&lt;/h2&gt;Continuing  with the Visual Basic Fusion theme of &quot;There&#39;s nothing in .NET that you  can&#39;t access from Visual Basic 6,&quot; I want to take some time to dig into  the functionality provided by the .NET Framework &lt;b&gt;System.Diagnostics&lt;/b&gt; classes. In particular, I want to take a look at the very useful &lt;b&gt;Process&lt;/b&gt; class, which lets you launch and control system processes, and show you  how you can use this class from a Visual Basic 6 application.&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;diagnosethis_topic2&quot;&gt;&lt;/a&gt;Tom, I Can Write That App in One Line of Code&lt;/h2&gt;Have  you ever noticed how .NET demonstrations often degrade to &quot;And all that  with just one line of code!&quot; It&#39;s almost like the coding version of  &quot;Name that Tune.&quot; In some ways, it&#39;s become a cliché.&lt;br /&gt; Well, I&#39;m a  sucker for clichés, so take a look at the application in Figure&amp;nbsp;1,  which shows extensive information about all the processes that are  currently running.&lt;br /&gt; &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa719098.diagnosethis01l%28l=en-us,v=vs.71%29.gif&quot;&gt;&lt;img alt=&quot;Click here for larger image&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC101596.gif&quot; /&gt;&lt;/a&gt;&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 1. Visual Basic .NET application that shows running process information (Click on the image for a larger picture)&lt;/b&gt;&lt;/div&gt;And all that with just one line of code! (See Listing&amp;nbsp;1.)&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 1. Visual Basic .NET code to display process information&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-1&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_ca2c63cc-2582-441a-8671-1c2c0fd64962&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;DataGrid1.DataSource = Process.GetProcesses()&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The .NET Framework contains a class called &lt;b&gt;Process&lt;/b&gt;. This class exposes functions that let you start processes, stop processes, and get information about running processes. The &lt;b&gt;GetProcesses&lt;/b&gt; function returns an array of information about all the currently  running processes. Visual Basic .NET supports databinding grids directly  to arrays, and so all you have to do is set the &lt;b&gt;DataSource&lt;/b&gt; property of the grid to the results returned from &lt;b&gt;GetProcesses&lt;/b&gt;, and you get all the process information displayed in a grid.&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;diagnosethis_topic3&quot;&gt;&lt;/a&gt;Using the Process Class from Visual Basic 6&lt;/h2&gt;Like most of the classes in the .NET Framework, the &lt;b&gt;Process&lt;/b&gt; class is not directly available to a Visual Basic 6 application.  Instead, you can expose the functionality of this class by creating a  simple wrapper in Visual Basic .NET.&lt;br /&gt; Listing&amp;nbsp;2 shows the code for the wrapper.&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 2. Visual Basic .NET wrapper class&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-2&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_bbf05e57-543c-4c42-b4a7-3bdd59990eef&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Imports System.Diagnostics&lt;br /&gt;&lt;br /&gt;Public Class ProcessWrapper&lt;br /&gt;&lt;br /&gt;#Region &quot;COM GUIDs&quot;&lt;br /&gt;    &#39; These  GUIDs provide the COM identity for this class &lt;br /&gt;    &#39; and its COM interfaces. If you change them, existing &lt;br /&gt;    &#39; clients will no longer be able to access the class.&lt;br /&gt;    Public Const ClassId As String = &quot;C655826A-F52C-4DE8-91DF-61B6C439B839&quot;&lt;br /&gt;    Public Const InterfaceId As String = &quot;2205598A-B161-421A-A6FF-2741418F2817&quot;&lt;br /&gt;    Public Const EventsId As String = &quot;9A7918EE-E3BA-41C8-A514-04B8D18DE605&quot;&lt;br /&gt;#End Region&lt;br /&gt;&lt;br /&gt;    &#39; A creatable COM class must have a Public Sub New() &lt;br /&gt;    &#39; with no parameters, otherwise, the class will not be &lt;br /&gt;    &#39; registered in the COM registry and cannot be created &lt;br /&gt;    &#39; via CreateObject.&lt;br /&gt;    Public Sub New()&lt;br /&gt;        MyBase.New()&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;    Public Function Start(ByVal command As String) As ProcessInfo&lt;br /&gt;        Dim p As Process = Process.Start(command)&lt;br /&gt;        Return New ProcessInfo(p)&lt;br /&gt;    End Function&lt;br /&gt;&lt;br /&gt;End Class&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This class was created by using the COM Class template in Visual Studio 2003, as follows:  &lt;br /&gt;&lt;ol type=&quot;1&quot;&gt;&lt;li&gt;Start Visual Studio 200, click the &lt;b&gt;File&lt;/b&gt; menu, and click&lt;b&gt; New Project&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;Under &lt;b&gt;Templates&lt;/b&gt;, select &lt;b&gt;Class Library&lt;/b&gt;. &lt;/li&gt;&lt;li&gt;In the &lt;b&gt;Name&lt;/b&gt; text box, enter &lt;b&gt;NetFrameworkWrappers&lt;/b&gt;, and click &lt;b&gt;OK&lt;/b&gt; (see Figure&amp;nbsp;2). &lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC174068.gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 2. Creating a new project&lt;/b&gt; &lt;/div&gt;&lt;/li&gt;&lt;li&gt;Click the &lt;b&gt;Project&lt;/b&gt; menu, and then click &lt;b&gt;Add New Item&lt;/b&gt;. &lt;/li&gt;&lt;li&gt;Under &lt;b&gt;Templates&lt;/b&gt;, select &lt;b&gt;COM Class&lt;/b&gt;. This allows you to create a class from Visual Basic .NET that will expose itself as a COM object. &lt;/li&gt;&lt;li&gt;In the &lt;b&gt;Name&lt;/b&gt; text box, enter &lt;b&gt;ProcessWrapper.vb&lt;/b&gt;, and then click &lt;b&gt;OK&lt;/b&gt; (see Figure&amp;nbsp;3). &lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC104364.gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 3. Adding ProcessWrapper.vb&lt;/b&gt; &lt;/div&gt;&lt;/li&gt;&lt;li&gt;At the top of the file, add the following line of code:  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-3&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_67e2d9b8-597a-4a56-b32b-3d71cfa75b44&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Imports System.Diagnostics&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;Add the following method to the class:  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-4&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_e8d13ed8-fbea-4a1d-a688-d14206172d9a&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Public Function Start(ByVal command As String) As ProcessInfo&lt;br /&gt;    Dim p As Process = Process.Start(command)&lt;br /&gt;    Return New ProcessInfo(p)&lt;br /&gt;End Function&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;Click the &lt;b&gt;Build&lt;/b&gt; menu, and then click &lt;b&gt;Build Solution&lt;/b&gt;. This will compile the class and register it as a COM object. &lt;/li&gt;&lt;/ol&gt;At this point, you can just add a reference to &lt;b&gt;NetFrameworkWrappers&lt;/b&gt; from a Visual Basic 6 application, and start using the &lt;b&gt;ProcessWrapper&lt;/b&gt; class (see Listing&amp;nbsp;3).&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 3. Using the ProcessWrapper class from Visual Basic 6&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-5&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_2837fd7c-ee22-4e83-acc0-151ee2117917&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Dim p As NetFrameworkWrappers.ProcessWrapper&lt;br /&gt;Set p = New NetFrameworkWrappers.ProcessWrapper&lt;br /&gt;p.Start (&quot;calc.exe&quot;)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The &lt;b&gt;Process&lt;/b&gt; class also exposes a &lt;b&gt;GetProcesses&lt;/b&gt; method that will return information about every process running on the system. The return value of &lt;b&gt;GetProcesses&lt;/b&gt; is an array of &lt;b&gt;Process&lt;/b&gt; classes, and therefore it is not directly consumable by Visual Basic 6. I created a wrapper for this as well. The &lt;b&gt;ProcessInfo&lt;/b&gt; wrapper class wraps the &lt;b&gt;Process&lt;/b&gt; class to surface information in a way that&#39;s directly consumable by Visual Basic 6. I can then create an array of &lt;b&gt;ProcessInfo&lt;/b&gt; classes, and return to my Visual Basic 6 code as shown in Listing&amp;nbsp;4.&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 4. Wrapping the results of GetProcesses so that it can be used from Visual Basic 6&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-6&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_1274fad5-01f7-4e7f-90f9-01eb0311d991&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Public Sub GetProcesses(ByRef procInfos() As ProcessInfo)&lt;br /&gt;    Dim processes() As Process = Process.GetProcesses&lt;br /&gt;    ReDim procInfos(processes.Length - 1)&lt;br /&gt;    For i As Integer = 0 To processes.Length - 1&lt;br /&gt;        procInfos(i) = New ProcessInfo(processes(i))&lt;br /&gt;    Next&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;You can see that this calls &lt;b&gt;GetProcesses&lt;/b&gt; to retrieve an array of &lt;b&gt;Process&lt;/b&gt; classes for each running process. I then loop through each one, and convert it to a &lt;b&gt;ProcessInfo&lt;/b&gt; class that was specifically designed to be consumable by Visual Basic 6. For example, the &lt;b&gt;TotalProcessorTime&lt;/b&gt; property of the &lt;b&gt;Process&lt;/b&gt; class used the .NET TimeSpan data type. This will not show up on the Visual Basic 6 side, and therefore the &lt;b&gt;ProcessInfo&lt;/b&gt; class instead returns this information simply as a string.&lt;br /&gt; &lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;diagnosethis_topic4&quot;&gt;&lt;/a&gt;Your Very Own Task Manager&lt;/h2&gt;I&#39;ve created a Visual Basic 6 sample application (see Figure&amp;nbsp;4) that uses the &lt;b&gt;Process&lt;/b&gt; wrappers to let you control all the processes on your machine. You can  launch processes, change a process priority, and even kill a process.&lt;br /&gt; &lt;div class=&quot;fig&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC67493.gif&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 4. Visual Basic 6 Process Manager&lt;/b&gt;&lt;/div&gt;When the form loads, it calls the &lt;b&gt;GetProcesses&lt;/b&gt; wrapper and places all the processes in a &lt;b&gt;ListView&lt;/b&gt; control (see Listing&amp;nbsp;5).&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 5. Loading the Visual Basic 6 form with process information&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-7&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_c55b47bd-d95f-44f8-9815-f47ab95995ac&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Public Sub LoadList()&lt;br /&gt;    ListView1.ListItems.Clear&lt;br /&gt;        &lt;br /&gt;    Dim p As NetFrameworkWrappers.ProcessWrapper&lt;br /&gt;    Set p = New NetFrameworkWrappers.ProcessWrapper&lt;br /&gt;    p.GetProcesses procs&lt;br /&gt;    &lt;br /&gt;    Dim i As Integer&lt;br /&gt;    For i = 0 To UBound(procs) - 1&lt;br /&gt;        Dim subItem As ListItem&lt;br /&gt;        Set subItem = ListView1.ListItems.Add(, , procs(i).ProcessName)&lt;br /&gt;        subItem.SubItems(1) = procs(i).Id&lt;br /&gt;        subItem.SubItems(2) = procs(i).BasePriority&lt;br /&gt;        subItem.SubItems(3) = procs(i).PriorityClass&lt;br /&gt;        subItem.SubItems(4) = procs(i).PriorityBoostEnabled&lt;br /&gt;        subItem.SubItems(5) = procs(i).MainWindowTitle&lt;br /&gt;        subItem.SubItems(6) = procs(i).MainWindowHandle&lt;br /&gt;        subItem.SubItems(7) = FormatNumber(procs(i).VirtualMemorySize / 1048576, 2) &amp;amp; &quot; MB&quot;&lt;br /&gt;        subItem.SubItems(8) = FormatNumber(procs(i).PeakVirtualMemorySize / 1048576, 2) &amp;amp; &quot; MB&quot;&lt;br /&gt;        subItem.SubItems(9) = FormatNumber(procs(i).WorkingSet / 1048576, 2) &amp;amp; &quot; MB&quot;&lt;br /&gt;        subItem.SubItems(10) = FormatNumber(procs(i).PeakWorkingSet / 1048576, 2) &amp;amp; &quot; MB&quot;&lt;br /&gt;        subItem.SubItems(11) = procs(i).Responding&lt;br /&gt;        subItem.SubItems(12) = procs(i).TotalProcessorTime&lt;br /&gt;        subItem.SubItems(13) = procs(i).UserProcessorTime&lt;br /&gt;        subItem.SubItems(14) = procs(i).HasExited&lt;br /&gt;    Next&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The &lt;b&gt;LoadList&lt;/b&gt; method is used whenever the &lt;b&gt;ListView&lt;/b&gt; needs to be repopulated with process information. It simply calls &lt;b&gt;ProcessWrapper.GetProcesses&lt;/b&gt;, passing in an empty array of &lt;b&gt;ProcessInfo&lt;/b&gt; classes. When the method returns, the array is populated, and the  method simply loops through the results and adds them to the list view.  Some values—for example, memory usage statistics—are formatted along the  way, so that they are more readable.&lt;br /&gt; The application contains a field where you can enter a process name and launch it (see Listing&amp;nbsp;6).&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 6. Launching a process from the Visual Basic 6 application&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-8&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_aff5ff19-bc05-4c13-bde7-47c8b79909b2&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Private Sub cmdLaunch_Click()&lt;br /&gt;    Dim p As NetFrameworkWrappers.ProcessWrapper&lt;br /&gt;    Set p = New NetFrameworkWrappers.ProcessWrapper&lt;br /&gt;    p.Start (txtProcessLaunch)&lt;br /&gt;    LoadList&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The application also lets you kill a process (see Listing&amp;nbsp;7).&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 7. Killing a process from the Visual Basic 6 application&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-9&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_af367332-21f2-4791-b3eb-8685637a766e&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Private Sub mnuKill_Click()&lt;br /&gt;    CurrentProc.Kill&lt;br /&gt;    LoadList&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;blockquote class=&quot;dtBlock&quot;&gt; &lt;b&gt;Note&lt;/b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;I don&#39;t think there&#39;s ever  been an example of killing a process that didn&#39;t come with the warning  that you really shouldn&#39;t go just killing processes willy-nilly. So  consider yourself warned.&lt;/blockquote&gt;Finally, you can change the priority of a running process (see Listing&amp;nbsp;8).&lt;br /&gt; &lt;div class=&quot;label&quot;&gt;&lt;b&gt;Listing 8. Changing the priority of a process from the Visual Basic 6 application&lt;/b&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-10&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_8ff6080a-6e2c-4a86-9df8-c2c5aea5a612&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Private Sub mnuSetPriority_Click()&lt;br /&gt;    Set frmModifyProcess.CurrentProc = CurrentProc&lt;br /&gt;    If frmModifyProcess.ShowDialog = vbOK Then&lt;br /&gt;        CurrentProc.PriorityClass = frmModifyProcess.PriorityClass&lt;br /&gt;        LoadList&lt;br /&gt;    End If&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;This simply displays another form that prompts the user to select a  process priority. When the user selects a priority and clicks &lt;b&gt;OK&lt;/b&gt; (see Figure&amp;nbsp;5), the form closes, and the information is returned. The process priority can be set simply by setting the &lt;b&gt;PriorityClass&lt;/b&gt; property of the &lt;b&gt;ProcessInfo&lt;/b&gt; class. This passes the information to the Visual Basic .NET component,  which changes the string back into the appropriate enumeration, and  changes the process priority.&lt;br /&gt; &lt;div class=&quot;fig&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC5701.gif&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;b&gt;Figure 5. Selecting a new process priority from the Visual Basic 6 application&lt;/b&gt;&lt;/div&gt;&lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;diagnosethis_topic5&quot;&gt;&lt;/a&gt;Running the Sample&lt;/h2&gt;Included  with this article is the Visual Basic 6 and Visual Basic .NET code for  working with processes. To run the sample, complete the following  procedures.&lt;br /&gt; If you do not have Visual Studio 2005 installed, you  need to download the (free) Microsoft .NET Framework, and the (free)  Visual Basic Express:  &lt;br /&gt;&lt;ul type=&quot;disc&quot;&gt;&lt;li&gt;Download and install &lt;a href=&quot;https://msdn.microsoft.com/vstudio/express/vb/&quot;&gt;Visual Basic 2005 Express&lt;/a&gt;. &lt;/li&gt;&lt;/ul&gt;At this point, you can download and run the sample:  &lt;br /&gt;&lt;ol type=&quot;1&quot;&gt;&lt;li&gt;Download and unzip the code for this article. &lt;/li&gt;&lt;li&gt;Within  the zip file, you will find a file called Build and Register.bat.  Double-click this to build and register the Visual Basic .NET COM  component. &lt;/li&gt;&lt;li&gt;In the ProcController folder, you will find the Visual Basic 6 sample application.&lt;/li&gt;&lt;/ol&gt;&lt;h2 class=&quot;dtH1&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;diagnosethis_topic6&quot;&gt;&lt;/a&gt;Conclusion&lt;/h2&gt;Once  again, you have seen that you can use powerful functionality in the  Microsoft .NET Framework easily from a Visual Basic 6 application in  order to get things done. The class used in this article was the &lt;b&gt;Process&lt;/b&gt; class, one of the many classes in the &lt;b&gt;System.Diagnostics&lt;/b&gt; section of the Framework Class Library.&lt;br /&gt; &lt;br /&gt;  &lt;b&gt;About the Author&lt;/b&gt; &lt;b&gt;Scott Swigart&lt;/b&gt; spends his time consulting, authoring, and speaking about emerging and  converging technologies. Scott has worked with a wide range of  technologies over his career, beginning with Commodore 64 programming at  the age of 12, writing hardware diagnostics for UNIX systems in C++,  and building Windows desktop and Web applications. Over the years, Scott  has worked with component development, XML technologies, .NET, Web  services, and other languages, platforms, and paradigms. With this  experience, Scott has seen how technology evolves over time, and he is  focused on helping organizations get the most out of the technology of  today while preparing for the technology of tomorrow. Scott is also a  Microsoft MVP, and co-author of numerous books and articles. Scott can  be reached at &lt;a href=&quot;mailto:scott@swigartconsulting.com&quot;&gt;scott@swigartconsulting.com&lt;/a&gt;.&lt;br /&gt;  &lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/1768933577089187411/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/diagnose-this-launching-and-controlling.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/1768933577089187411'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/1768933577089187411'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/diagnose-this-launching-and-controlling.html' title='Diagnose This: Launching and Controlling System Processes with Visual Basic 6 and the .NET Framework'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-4247952047648177604</id><published>2017-03-14T11:16:00.000-07:00</published><updated>2017-03-14T11:16:05.652-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Deploying the Hybrid Visual Basic 6.0 and Visual Basic .NET Application</title><content type='html'>&lt;div class=&quot;topic&quot;&gt;  &lt;h1 class=&quot;title&quot;&gt;&lt;/h1&gt;&lt;div class=&quot;lw_vs&quot;&gt;    &lt;div id=&quot;curversion&quot;&gt;      &lt;strong&gt;                Visual Studio 2005             &lt;/strong&gt;    &lt;/div&gt;&lt;/div&gt;&lt;div id=&quot;mainSection&quot;&gt; &lt;div id=&quot;mainBody&quot;&gt;  &lt;span style=&quot;color: darkgrey;&quot;&gt; &lt;/span&gt; &lt;span id=&quot;changeHistory&quot;&gt; &lt;/span&gt; &lt;br /&gt; &lt;b&gt;Sales Support: A Hybrid Visual Basic 6.0 &amp;amp; Visual Basic 2005 Application, Part 4&lt;/b&gt; &lt;br /&gt; Scott Swigart&lt;br /&gt; February 2008&lt;br /&gt;  &lt;b&gt;Summary:&lt;/b&gt; This article—the last in a four-part series that walks through  enhancing an existing Microsoft Visual Basic 6.0 application by using  functionality that is expected of modern applications—focuses solely on  deployment considerations. (18 printed pages)&lt;br /&gt; &lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Contents&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle0&quot;&gt;&lt;/a&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299498%28vs.80%29.aspx#HybridPartIV_topic1&quot;&gt;Introduction&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299498%28vs.80%29.aspx#HybridPartIV_topic2&quot;&gt;Application Dependencies&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299498%28vs.80%29.aspx#HybridPartIV_topic3&quot;&gt;Building the VBNET_Extensions Installer&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299498%28vs.80%29.aspx#HybridPartIV_topic4&quot;&gt;Turning VBNET_Extensions into a Prerequisite for SalesSupport83&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299498%28vs.80%29.aspx#HybridPartIV_topic5&quot;&gt;Building the Bootstrapper Setup.exe&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299498%28vs.80%29.aspx#HybridPartIV_topic6&quot;&gt;Conclusion&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartIV_topic1&quot;&gt;&lt;/a&gt;&lt;h3 class=&quot;subHeading&quot;&gt;Introduction&lt;/h3&gt;&lt;div class=&quot;subSection&quot;&gt; This  article series, &quot;Sales Support: A Hybrid Visual Basic 6.0 &amp;amp; Visual  Basic 2005 Application,&quot; walks through enhancing an existing Microsoft  Visual Basic 6.0 application by using functionality that is expected of  modern applications. The application enhancements were coded in  Microsoft Visual Basic .NET, simply because it was more productive and  better suited to develop the desired functionality.&lt;br /&gt; The key message of this article series is that &lt;i&gt;the existing Visual Basic 6.0 application did not need to be migrated to Visual Basic .NET.&lt;/i&gt; The existing application was just enhanced by using small amounts of  Visual Basic .NET code. This technique should be strongly considered if  you have a large existing Visual Basic 6.0 code base that you are still  maintaining and enhancing.&lt;br /&gt; In Part 1 of this article series, &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299499%28v=vs.80%29.aspx&quot;&gt;Enhancing an Application with Windows Desktop Search and Office Outlook Integration&lt;/a&gt;,  I showed that it is not necessary to migrate a Visual Basic 6.0  application to Visual Basic 2005 in order to take advantage of .NET  functionality. Instead, you can integrate Microsoft Windows Desktop  Search into a Visual Basic 6.0 application by using COM objects that  have been created with Visual Basic 2005.&lt;br /&gt; In Part 2, &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299495%28v=vs.80%29.aspx&quot;&gt;Enhancing a Visual Basic 6.0 Application with MapPoint Web Service&lt;/a&gt;,  I demonstrated how to enhance the same application to display maps for  locations in an existing database by calling into Microsoft MapPoint Web  Service.&lt;br /&gt; In Part 3, &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299496%28v=vs.80%29.aspx&quot;&gt;Enhancing a Visual Basic 6.0 Application with the ReportViewer Control&lt;/a&gt;, I showed how to add reporting capabilities to the application.&lt;br /&gt; If  you have yet to read the previous articles, I strongly recommend that  you read at least the first one, to familiarize yourself with the  application. This article will focus solely on deployment  considerations.&lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartIV_topic2&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Application Dependencies&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle1&quot;&gt;&lt;/a&gt; When  planning a deployment, it&#39;s important to understand your application  dependencies. In this case, the Sales Support application is a Visual  Basic 6.0 program that is dependent on extensions that are written in  Visual Basic .NET. The application dependencies are diagrammed in Figure  1.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC152398.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 1. Application dependencies&lt;/b&gt; &lt;br /&gt; The  various components of this application must be packaged as part of the  deployment. The Sales Support Application is installed by using a  traditional Microsoft Visual Studio 6.0 Package and Deployment wizard  setup.exe file. The VBNET_Extensions DLL, which provides the  functionality for all of the preceding screen shots, is packaged by  using a Visual Studio 2005 setup project. The application is also  dependent on Microsoft SQL Server 2005 and the Microsoft .NET Framework  2.0, which are also packaged with the Sales Support installation.&lt;br /&gt; The  installation is somewhat complicated because an existing Visual Basic  application, the VB.NET components, the .NET Framework, and SQL Server  2005 Express Edition must all be installed. Each of these components has  its own stand-alone installer. Somehow, these all must be bound  together, so that the user need only run a single setup.exe file to  install everything.&lt;br /&gt; The way to accomplish this is to use a  bootstrapper setup.exe file. A bootstrapper can install any number of  prerequisite packages and then launch the setup for the main  application. This allows the .NET Framework 2.0, SQL Server 2005 Express  Edition, and VBNET_Extensions to be installed as prerequisites to the  Sales Support application.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC161165.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 2. Steps in constructing the full installer&lt;/b&gt; &lt;br /&gt; The  first component that must be constructed is the installer for the  VBNET_Extensions DLL. This is accomplished simply by using a Visual  Studio 2005 setup project, as shown in box (1) of Figure 2.&lt;br /&gt; When building a bootstrapper, the bootstrapper &quot;understands&quot; the concept of &lt;i&gt;prerequisites&lt;/i&gt;.  Prerequisites are components that must be installed prior to the main  application. You can include built-in prerequisites, such as the .NET  framework or SQL Server 2005 Express Edition. However, for the Sales  Support application, the VBNET_Extensions must be installed as a  prerequisite to the main Sales Support application. The Bootstrap  Manifest Generator utility is used to configure the VBNET_Extensions  installer, so that it can be chosen as a prerequisite, as shown in box  (2) of Figure 2.&lt;br /&gt; MSBuild is then used to generate the  bootstrapper setup.exe, and copy all of the prerequisite installers to a  deployment folder. When MSBuild completes, you have a single folder  that contains the setup.exe, all of the prerequisites, and the legacy  installer. This entire folder could be copied either to a network share  or to a CD.&lt;br /&gt; When the bootstrapper setup.exe is executed, it  installs the prerequisite components in the order that is shown in  Figure 2, and then it starts the installation of the installer for the  Sales Support application.&lt;br /&gt; That’s a lot of steps, and, depending  on your familiarity with deployment, it all might have been confusing.  But each step in the process is straightforward; the following sections  will walk through constructing each section of the installation in more  detail.&lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartIV_topic3&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Building the VBNET_Extensions Installer&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle2&quot;&gt;&lt;/a&gt; Visual Studio 2005 allows you to add a &lt;i&gt;setup project&lt;/i&gt; to an existing solution. This type of project provides functionality  that is similar to the Visual Basic 6.0 Package and Deployment wizard,  and makes it relatively easy to build a deployment for a Visual Basic  .NET application or DLL.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC107967.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 3. Adding a setup project to the VBNET_Extensions solution&lt;/b&gt; &lt;br /&gt; When  you build a deployment, the first step is to select what you want to  deploy. This deployment should deploy the VBNET_Extensions DLL, which  contains the forms that were shown in the earlier screen shots. This was  accomplished by right-clicking the VBNET_Extensions_Install project in  the Solution Explorer, and then selecting &lt;b&gt;Add&lt;/b&gt; | &lt;b&gt;Project Output&lt;/b&gt;. This displays the &lt;b&gt;Add Project Output Group&lt;/b&gt; dialog box, as shown in Figure 4.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC149157.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 4. Add Project Output Group dialog box&lt;/b&gt; &lt;br /&gt; The &lt;b&gt;Add Project Output Group&lt;/b&gt; dialog box shows that the primary output of the VBNET_Extensions  project should be packaged and deployed. Generally, the primary output  is the application executable or, in this case, the VBNET_Extensions  DLL.&lt;br /&gt; After the VBNET_Extensions primary output has been added to  the VBNET_Extensions_Install setup project, Visual Studio automatically  detects any dependencies and targets them for deployment, too. You can  see what will be installed, and where, by right-clicking on the  VBNET_Extensions_Install project, and selecting &lt;b&gt;View&lt;/b&gt; | &lt;b&gt;File System&lt;/b&gt;. As shown in Figure 5, the &lt;b&gt;Microsoft.InteropFormsTools&lt;/b&gt; assembly and assemblies that are needed by the &lt;b&gt;ReportViewer&lt;/b&gt; control will be bundled with the application and deployed to the  Application folder (which defaults to a folder under C:\Program Files)  on the target computer.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC134785.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 5. Files that will be deployed to the Application folder&lt;/b&gt; &lt;br /&gt; Often,  installations must perform certain custom actions beyond just copying  files to the correct folder. For example, this application must install a  database file and attach that file to SQL Server 2005 Express Edition.  These kinds of operations are best performed through a custom action.  The easiest way to create a custom action is to add a new Class Library  project to the solution. In this Class Library project, you can code any  operations that must be performed as part of the installation.&lt;br /&gt; To  perform custom actions for the VBNET_Extensions component, a class  library that is called InstallerClassLibrary is added to the solution.  An &lt;b&gt;InstallerClass&lt;/b&gt; item is added to this project. An &lt;b&gt;InstallerClass&lt;/b&gt; is just a class that inherits the &lt;b&gt;System.Configuration.Install.Installer&lt;/b&gt; base class. This base class allows the Windows installer to call into  this class during the install, commit, rollback, and uninstall stages of  an installation. You can provide code for any of these installation  stages by overriding base-class methods, as shown in Listing 1.&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-1&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_4caea2ce-8a85-4633-92ab-4e49991fd6e7&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    Public Overrides Sub Install( _&lt;br /&gt;        ByVal stateSaver As System.Collections.IDictionary)&lt;br /&gt;&lt;br /&gt;        Dim sf As New StatusForm&lt;br /&gt;        sf.Message = &quot;Select a server where the database should be installed.&quot;&lt;br /&gt;&lt;br /&gt;        sf.ShowDialog()&lt;br /&gt;&lt;br /&gt;        stateSaver.Add(&quot;DBInstance&quot;, sf.DBInstance)&lt;br /&gt;&lt;br /&gt;        MyBase.Install(stateSaver)&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;b&gt;Listing 1. Providing a custom installation action&lt;/b&gt; &lt;br /&gt; The &lt;b&gt;Install&lt;/b&gt; function examines the computer to determine which instances of SQL  Server are installed. SQL Server 2005 Express Edition will be installed  with the application, but you might have another instance of SQL Server  already installed. By using a custom form, the installer will &quot;ask&quot; you  to which instance of SQL Server you want to attach the Sales Support  database.&lt;br /&gt; The SQL Server database file SalesSupport83.mdf also is  added to the InstallerClassLibrary project. This will allow the actual  database file to be deployed along with the application.&lt;br /&gt; After  the custom action has been coded, it also must be deployed by the  installer. This is accomplished by right-clicking the  VBNET_Extensions_Install setup project and selecting &lt;b&gt;Add&lt;/b&gt; | &lt;b&gt;Project Output&lt;/b&gt;.  This time, the InstallerClassLibrary project is chosen for the project,  and Primary Output and Content Files are selected for deployment.  Choosing &lt;b&gt;Content Files&lt;/b&gt; ensures that other ancillary files are  included in the deployment. The SalesSupport83.mdf database file is  considered a content file, and selecting this option ensures that this  file is packaged with the deployment.&lt;br /&gt; Finally, the  InstallerClassLibrary must be connected to the installer, so that it  will be triggered during the Install stage of the installation process.  This is accomplished by right-clicking the VBNET_Extensions_Install  project and selecting &lt;b&gt;View&lt;/b&gt; | &lt;b&gt;Custom Actions&lt;/b&gt;.&lt;br /&gt; From  the Custom Actions window, you can trigger custom code for various  stages of the installation. For this deployment, the  InstallerClassLibrary must be triggered during the Install stage. This  is accomplished by right-clicking &lt;b&gt;Install&lt;/b&gt; and selecting &lt;b&gt;Add Custom Action&lt;/b&gt;.  The installer must know the location where the custom-action executable  code can be found. This illustrates why the custom-action DLL must be  deployed with your application. It is run on the target computer during  the installation, so that it must be packaged with the deployment. In  this case, it is found in the Application folder and appears as &quot;Primary  output from InstallerClassLibrary,&quot; as shown in Figure 6.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC163055.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 6. Hooking the database-installation custom action to the installer&lt;/b&gt; &lt;br /&gt; The installation can now be built by right-clicking the VBNET_Extensions_Install project and selecting &lt;b&gt;Build&lt;/b&gt;.&lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartIV_topic4&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Turning VBNET_Extensions into a Prerequisite for SalesSupport83&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle3&quot;&gt;&lt;/a&gt; At  this point, the pieces are in place to install the complete  application. However, the installation is not integrated into a single  setup.exe. The user would have to install the legacy SalesSupport83  Visual Basic application, as well as the .NET Framework 2.0 and SQL  Server 2005 Express Edition. Finally, the user would have to install  also the VBNET_Extensions DLL.&lt;br /&gt; To integrate these components so  that they are installed from a single setup, a bootstrapper is needed.  The bootstrapper installs the .NET Framework 2.0, SQL Server 2005  Express Edition, and VBNET_Extensions as application prerequisites. The  bootstrapper then launches the legacy SalesSupport83 setup.exe to  install the main application.&lt;br /&gt; Installing the .NET Framework 2.0,  and SQL Server 2005 Express Edition as application prerequisites is as  easy as checking a couple of check boxes. However, the VBNET_Extensions  DLL is custom code, and a little work must be done for it to be  installed as a prerequisite. The easiest way to accomplish this is by  using &lt;a href=&quot;http://www.codeplex.com/bmg&quot;&gt;Bootstrap Manifest Generator&lt;/a&gt; (BMG), which is available as a free product from CodePlex.&lt;br /&gt; BMG  allows you to take an existing application installer and turn it into a  package that can be used as an application prerequisite. To turn  VBNET_Extensions into a prerequisite package, BMG is started, and then  Package Manifest is chosen for the new project type, as shown in Figure  7.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC1490.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 7. Creating a new package manifest&lt;/b&gt; &lt;br /&gt; This step prompts you to provide information about the package that you want to build, as shown in Figure 8.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC170713.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 8. Entering basic information about the package&lt;/b&gt; &lt;br /&gt; Next,  the BMG must be given the location of the VBNET_Extensions installer.  This is done by clicking the Add Install File toolbar icon, which  appears directly above the word &quot;Package.&quot; The MSI installer for  VBNET_Extensions is then chosen, as shown in Figure 9.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC134486.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 9. Selecting the VBNET_Extensions installer to make a prerequisite package&lt;/b&gt; &lt;br /&gt; When  the bootstrapper setup.exe installs the prerequisites, it requires a  way of knowing whether the prerequisite installed correctly or  experienced an error. This information is provided to the bootstrapper  by selecting the VBNET_Extensions_Install.msi, under Package, and then  selecting the &lt;b&gt;Exit Codes&lt;/b&gt; tab, as shown in Figure 10.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC133166.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 10. Configuring Success and Failure exit codes&lt;/b&gt; &lt;br /&gt; Under &lt;b&gt;Custom Exit Codes&lt;/b&gt;, an exit code of &lt;b&gt;0&lt;/b&gt; is added to indicate success. If this is not added, even though the  VBNET_Extensions prerequisite will install without error, the  bootstrapper will always &quot;think&quot; that the installation failed.&lt;br /&gt; The  prerequisite package can now be built. This is accomplished by clicking  the Build toolbar icon, which is located on the left, directly above  the word &quot;Package.&quot;&lt;br /&gt; A build-output window opens, as shown in  Figure 11. BMG creates the needed package directory and files under the  Visual Studio 2005 installation, so that VBNET_Extensions can be  installed as a prerequisite, just as the .NET Framework 2.0 or SQL  Server 2005 Express Edition was.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC35315.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 11. Build output when creating a package&lt;/b&gt; &lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartIV_topic5&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Building the Bootstrapper Setup.exe&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle4&quot;&gt;&lt;/a&gt; At  this point, a legacy setup.exe installer exists for the main Sales  Support application. The VBNET_Extensions had been packaged, so that it  can be installed as an application prerequisite. Out of the box, the  .NET Framework 2.0 and SQL Server 2005 Express Edition can be installed  as prerequisites. So that everything is installed from a single  setup.exe file, one final step is required to glue everything together:  to build the setup.exe itself.&lt;br /&gt; This setup.exe is known as a  bootstrapper, which means that the only thing that it &quot;knows&quot; how to do  is kick off other installers. It will launch the install for the .NET  Framework 2.0, the install for SQL Server 2005 Express Edition, the  install for the custom VBNET_Extensions DLL, and, finally, the legacy  setup.exe for the Visual Basic 6.0 Sales Support application.&lt;br /&gt; The  bootstrapper is generated by running a utility that is called MSBuild.  Typically, MSBuild is used to compile projects from the command line.  MSBuild can compile files, and it can perform other tasks that are  commonly needed for an automated build process, such as copying files.  MSBuild is driven by an XML file that contains the specific build  instructions. The MSBuild project file for building the bootstrapper is  shown in Listing 2.&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-2&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_dea2036f-7780-4f1a-9ba6-a8668535de51&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;&amp;lt;Project xmlns=&quot;http://schemas.microsoft.com/developer/msbuild/2003&quot;&amp;gt;&lt;br /&gt;  &amp;lt;ItemGroup&amp;gt;&lt;br /&gt;    &amp;lt;BootstrapperFile Include=&quot;Microsoft.Net.Framework.2.0&quot;&amp;gt;&lt;br /&gt;      &amp;lt;ProductName&amp;gt;.NET Framework 2.0&amp;lt;/ProductName&amp;gt;&lt;br /&gt;    &amp;lt;/BootstrapperFile&amp;gt;&lt;br /&gt;    &amp;lt;BootstrapperFile Include=&quot;Microsoft.Sql.Server.Express.1.0&quot;&amp;gt;&lt;br /&gt;      &amp;lt;ProductName&amp;gt;SQL Server 2005 Express Edition&amp;lt;/ProductName&amp;gt;&lt;br /&gt;    &amp;lt;/BootstrapperFile&amp;gt;&lt;br /&gt;    &amp;lt;BootstrapperFile Include=&quot;VBNET_Extensions&quot;&amp;gt;&lt;br /&gt;      &amp;lt;ProductName&amp;gt;VBNET_Extensions&amp;lt;/ProductName&amp;gt;&lt;br /&gt;    &amp;lt;/BootstrapperFile&amp;gt;&lt;br /&gt;    &amp;lt;BootstrapperFile Include=&quot;Microsoft.Windows.Installer.3.1&quot;&amp;gt;&lt;br /&gt;      &amp;lt;ProductName&amp;gt;Windows Installer 3.1&amp;lt;/ProductName&amp;gt;&lt;br /&gt;    &amp;lt;/BootstrapperFile&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;SourceFiles&lt;br /&gt;      Include=&quot;$(MSBuildProjectDirectory)\..\SalesSupportV8_3\Package\setup.exe;&lt;br /&gt;      $(MSBuildProjectDirectory)\..\SalesSupportV8_3\Package\SalesSupport.cab;&lt;br /&gt;      $(MSBuildProjectDirectory)\..\SalesSupportV8_3\Package\Setup.LST&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;/ItemGroup&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;Target Name=&quot;Bootstrapper&quot;&amp;gt;&lt;br /&gt;    &amp;lt;Copy&lt;br /&gt;      SourceFiles=&quot;@(SourceFiles)&quot;&lt;br /&gt;      DestinationFolder=&quot;$(MSBuildProjectDirectory)\Deployment\SalesSupport&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;    &amp;lt;GenerateBootstrapper&lt;br /&gt;      BootstrapperItems=&quot;@(BootstrapperFile)&quot;&lt;br /&gt;      ApplicationFile=&quot;SalesSupport\setup.exe&quot;&lt;br /&gt;      ApplicationName=&quot;Sales Support Installer&quot;&lt;br /&gt;      ComponentsLocation=&quot;Relative&quot;&lt;br /&gt;      Culture=&quot;en&quot;&lt;br /&gt;      FallbackCulture=&quot;en-US&quot;&lt;br /&gt;      CopyComponents=&quot;True&quot;&lt;br /&gt;      Validate=&quot;False&quot;&lt;br /&gt;      OutputPath=&quot;$(MSBuildProjectDirectory)\Deployment&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;/Target&amp;gt;&lt;br /&gt;&amp;lt;/Project&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;b&gt;Listing 2. Sales Support Bootstrapper.msbuild file&lt;/b&gt; &lt;br /&gt; The &lt;b&gt;ItemGroup&lt;/b&gt; section contains a listing of the packages that will be installed as  prerequisites. Notice that this list includes the built-in packages for  the .NET Framework 2.0 and SQL Server 2005 Express Edition. Notice also  that the custom VBNET_Extensions package appears in the list. This  package was created in the &quot;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299498%28vs.80%29.aspx#HybridPartIV_topic4&quot;&gt;Turning VBNET_Extensions into a Prerequisite for SalesSupport83&lt;/a&gt;&quot; section, earlier in this document.&lt;br /&gt; As  part of the build process, the legacy installer (built by the Visual  Basic 6.0 Package and Deployment wizard) must be copied into a  Deployment directory. This is accomplished by listing the installer  files in the &lt;b&gt;SourceFiles&lt;/b&gt; tag, and then referencing that list in the Copy task under the Bootstrapper target.&lt;br /&gt; The &lt;b&gt;GenerateBootstrapper&lt;/b&gt; tag contains the information that MSBuild requires to build the actual bootstrapper setup.exe. The &lt;b&gt;BootstrapperItems&lt;/b&gt; attribute references the prerequisites that must be included. The &lt;b&gt;ApplicationFile&lt;/b&gt; attribute specifies the legacy installer that will be executed after the prerequisites are installed. The &lt;b&gt;OutputPath&lt;/b&gt; specifies the folder in which the bootstrapper will be built and to which the prerequisites will be copied.&lt;br /&gt; The  bootstrapper is built by using the MSBuild command line. To run  MSBuild, open the Visual Studio command prompt, which can be found under  the &lt;b&gt;Start&lt;/b&gt; menu (under &lt;b&gt;All Programs&lt;/b&gt; | &lt;b&gt;Visual Studio 2005&lt;/b&gt; | &lt;b&gt;Visual Studio Tools&lt;/b&gt; | &lt;b&gt;Visual Studio 2005 Command Prompt&lt;/b&gt;). MSBuild runs and generates the bootstrapper setup.exe by entering the command &lt;b&gt;msbuild &quot;Sales Support Bootstrapper.msbuild&quot;&lt;/b&gt;. The output is shown in Figure 12.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC10611.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 12. Output from building the bootstrapper&lt;/b&gt; &lt;br /&gt; The  full deployment folder is shown in Figure 13. The contents of this  folder can be copied to a CD, &quot;zipped&quot; for download, or packaged  otherwise for distribution.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC105672.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 13. Complete deployment folder&lt;/b&gt; &lt;br /&gt; The  entire application, including the .NET Framework 2.0, SQL Server 2005  Express Edition, and the VBNET_Extensions, are installed by just  executing the setup.exe.&lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartIV_topic6&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Conclusion&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle5&quot;&gt;&lt;/a&gt; Packaging  products for distribution is, and always has been, difficult.  Applications have prerequisites, and they often require custom code to  run during the installation, for example, to attach databases, migrate  settings from previous versions, and so forth.&lt;br /&gt; Deploying a hybrid  Visual Basic 6.0 and Visual Basic .NET application adds additional  complexity. The coding that you do in Visual Basic .NET likely will be  compiled into a DLL that must be deployed. The application is now  dependent on the .NET Framework, which should be included as a  prerequisite.&lt;br /&gt; I hope that this article eases the task by giving  you concrete information that you can use when you deploy your own  hybrid applications. In my opinion, this is still far easier than  porting the entire legacy Visual Basic 6.0 application to Visual Basic  .NET.&lt;br /&gt; Building hybrid applications allows you to maintain your  existing application investment, learn the .NET Framework and Visual  Basic .NET incrementally, and incur very little risk.&lt;br /&gt;  &lt;div class=&quot;subSection&quot;&gt;  &lt;h4 class=&quot;subHeading&quot;&gt;About the author&lt;/h4&gt;&lt;div class=&quot;subSection&quot;&gt; Scott  Swigart spends his time consulting, authoring, and speaking about  converging and emerging technologies. With development experience going  back over 15 years, and by staying in constant contact with future  software-development technologies, Scott is able to help organizations  get the most out of today&#39;s technology while they prepare to leverage  the technology of tomorrow. Scott is also the author of several .NET  books, a certified Microsoft trainer (MCT) and developer (MCSD), and a  Microsoft MVP. Feel free to contact the Scott at &lt;a alt=&quot;&quot; href=&quot;mailto:scott@swigartconsulting.com&quot; target=&quot;_blank&quot;&gt;scott@swigartconsulting.com&lt;/a&gt;, or check out his latest musings at &lt;a href=&quot;http://blog.swigartconsulting.com/&quot;&gt;blog.swigartconsulting.com&lt;/a&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;</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/4247952047648177604/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/deploying-hybrid-visual-basic-60-and.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/4247952047648177604'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/4247952047648177604'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/deploying-hybrid-visual-basic-60-and.html' title='Deploying the Hybrid Visual Basic 6.0 and Visual Basic .NET Application'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-121785868531715512</id><published>2017-03-14T11:13:00.003-07:00</published><updated>2017-03-14T11:13:49.552-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Automatically Updating Visual Basic 6 Applications: Part I</title><content type='html'>&lt;h1 class=&quot;title&quot;&gt;&lt;/h1&gt;&lt;div class=&quot;lw_vs&quot;&gt;    &lt;div id=&quot;curversion&quot;&gt;      &lt;strong&gt;                Visual Studio 2005             &lt;/strong&gt;    &lt;/div&gt;&lt;/div&gt;&amp;nbsp; Scott Swigart&lt;br /&gt;Swigart Consulting LLC&lt;br /&gt;  May 2006&lt;br /&gt;  Applies to:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft Visual Basic 6.0&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft Visual Basic 2005&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft Visual Basic Express 2005 Edition&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Microsoft Visual Studio 2005&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;.NET Framework 2.0&lt;br /&gt;  &lt;strong&gt;Summary: &lt;/strong&gt;This article shows how you can add  automatic updating functionality to your existing Visual Basic 6.0  applications, using features now available with the .NET Framework 2.0.  (10 printed pages)&lt;br /&gt;  Click &lt;a href=&quot;http://download.microsoft.com/download/b/3/4/b348ed20-2372-491e-8f06-23c6917f0d4a/Auto_Updating_Visual_Basic_6_Part%20I.msi&quot;&gt;here&lt;/a&gt; to download the code sample for this article.&lt;br /&gt;   &lt;h4 class=&quot;dtH1&quot;&gt;Contents&lt;/h4&gt;&lt;a href=&quot;https://msdn.microsoft.com/library/aa697430%28vs.80%29.aspx#autoupdatvb6apps_topic1&quot;&gt;Introduction&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://msdn.microsoft.com/library/aa697430%28vs.80%29.aspx#autoupdatvb6apps_topic2&quot;&gt;ClickOnce Deployment&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://msdn.microsoft.com/library/aa697430%28vs.80%29.aspx#autoupdatvb6apps_topic3&quot;&gt;ClickOnce Deploying a Visual Basic 6.0 Application&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://msdn.microsoft.com/library/aa697430%28vs.80%29.aspx#autoupdatvb6apps_topic4&quot;&gt;Versioning&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://msdn.microsoft.com/library/aa697430%28vs.80%29.aspx#autoupdatvb6apps_topic5&quot;&gt;Conclusion&lt;/a&gt;&lt;br /&gt;  &lt;h2 class=&quot;dtH1&quot;&gt;Introduction&lt;/h2&gt;Deploying applications is hard. It takes time to build and test  installers. Applications often require additional COM components to  operate, and these components require registration. You also have to  consider how you&#39;re going to physically distribute the bits. Will you  burn a CD? Will you zip them up and place them on a website for  downloading? Will you use a product like &lt;a href=&quot;https://www.microsoft.com/smserver/default.mspx&quot;&gt;SMS&lt;/a&gt; to push them out?&lt;br /&gt;  Versioning applications is also hard. You may have previous versions  of the application installed that may require removal. Applications  today are expected to somehow know when a new version is available,  prompt you to see whether you want to install it, and then take care of  the rest.&lt;br /&gt;  Visual Basic 6.0 allows you to build installers to address some of  these issues. Third-party products offer even more capabilities for  deploying and versioning application, but automatic updating can be  tricky. Visual Basic 6.0 provides no capabilities for making an  application that automatically detects, downloads, and installs a new  version of itself. Rolling your own capability for this would be, for  lack of a better term, hard.&lt;br /&gt;  &lt;h2 class=&quot;dtH1&quot;&gt;ClickOnce Deployment&lt;/h2&gt;Automatic application updating is a feature that Microsoft has been  working to simplify. With Visual Studio 2005 and the .NET Framework 2.0,  Microsoft provides a built-in solution for robust application  deployment and automatic updating. While this technology, known as  ClickOnce deployment, was developed with .NET applications in mind, it  can be used to automate the deployment and updating of Visual Basic 6.0  applications. Considering that bazillions of lines of Visual Basic 6.0  code will continue to run in production for some time, this might be a  useful thing.&lt;br /&gt;  &lt;h3 class=&quot;dtH1&quot;&gt;Getting Started&lt;/h3&gt;To begin with ClickOnce deployment, it&#39;s important to have the latest  version of Visual Studio. If you already have Visual Studio 2005  installed, that&#39;s great! Otherwise, I strongly recommend that you  download and install the free &lt;a href=&quot;https://msdn.microsoft.com/vstudio/express/vb/&quot;&gt;Visual Basic Express&lt;/a&gt;.  Visual Basic Express provides all the functionality that you need in  order to ClickOnce deploy applications. It&#39;s a free, trimmed-down  version of the full Visual Studio 2005, but unlike typical evaluation  software, it doesn&#39;t timeout.&lt;br /&gt;  This article will walk you, step by step, through the process of  ClickOnce deploying a Visual Basic 6 application. The steps in this  article are written for Windows XP with Internet Information Server  (IIS) installed. This technique should work on other versions of  Windows, but the steps for configuring Internet Information Server will  vary slightly.&lt;br /&gt;  The first steps will walk you through using Visual Basic Express to  ClickOnce deploy a Visual Basic .NET application. This .NET application  will become the launcher for your Visual Basic 6.0 application. It will  check for, download, and install new versions automatically.  &lt;br /&gt;&lt;ol&gt;&lt;li&gt;Start Visual Basic Express or Visual Studio 2005.&lt;/li&gt;&lt;li&gt;Click the &lt;strong&gt;File&lt;/strong&gt; menu, and then click &lt;strong&gt;New Project&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Create a Visual Basic Windows Application. Name the application MyAppLauncher.&lt;/li&gt;&lt;li&gt;Click the &lt;strong&gt;File&lt;/strong&gt; menu, and then click &lt;strong&gt;Save All&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;Save Project &lt;/strong&gt;dialog box that appears, click &lt;strong&gt;Save&lt;/strong&gt;. You should now see the form designer, which will let you create the  launcher application. Initially, this will be a trivial application that  will let you get familiar with ClickOnce deployment. Later, this will  include your Visual Basic 6.0 application, and you will see how it can  automatically update itself. &lt;/li&gt;&lt;li&gt;In the Solution Explorer, double-click &lt;strong&gt;My Project&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Click the &lt;strong&gt;Publish&lt;/strong&gt; tab on the left side. The &lt;strong&gt;Publish&lt;/strong&gt; tab shows the options related to  ClickOnce deployment (see Figure&amp;nbsp;1). When you ClickOnce deploy your  application, it will be posted on a website, allowing the user to  download, install, and execute the application with a single click. The  application will also download and install any needed prerequisites,  such as the .NET Framework 2.0.  &lt;br /&gt;&lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;Aa697430.autoupdatvb6apps01(en-US,VS.80).gif&quot; id=&quot;autoupdatvb6apps01&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC10587.gif&quot; title=&quot;Aa697430.autoupdatvb6apps01(en-US,VS.80).gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 1. ClickOnce settings&lt;/strong&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;On the &lt;strong&gt;Publish&lt;/strong&gt; tab, click &lt;strong&gt;Prerequisites&lt;/strong&gt; if you want to select additional packages to download and install with  your application (see Figure&amp;nbsp;2). The .NET Framework 2.0 is a  requirement, but you might also want to download and install MDAC 2.8,  for example. &lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;Aa697430.autoupdatvb6apps02(en-US,VS.80).gif&quot; id=&quot;autoupdatvb6apps02&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC70899.gif&quot; title=&quot;Aa697430.autoupdatvb6apps02(en-US,VS.80).gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 2. Selecting prerequisites&lt;/strong&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;On the &lt;strong&gt;Publish&lt;/strong&gt; tab, click &lt;strong&gt;Updates&lt;/strong&gt; to configure when the application checks for new versions (see  Figure&amp;nbsp;3). The default is to check before the application starts, but  you can have the application check in the background while it&#39;s running. &lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;Aa697430.autoupdatvb6apps03(en-US,VS.80).gif&quot; id=&quot;autoupdatvb6apps03&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC133422.gif&quot; title=&quot;Aa697430.autoupdatvb6apps03(en-US,VS.80).gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 3. Configuring when to check for updates&lt;/strong&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;On the &lt;strong&gt;Publish&lt;/strong&gt; tab, click &lt;strong&gt;Publish Now&lt;/strong&gt; to compile and deploy the application to your local Web server. Once  the application has been deployed, the Web page in Figure&amp;nbsp;4 will be  displayed, allowing you, or any other user, to download and install the  prerequisites and the application. &lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;Aa697430.autoupdatvb6apps04(en-US,VS.80).gif&quot; id=&quot;autoupdatvb6apps04&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC167853.gif&quot; title=&quot;Aa697430.autoupdatvb6apps04(en-US,VS.80).gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 4. Web installation page&lt;/strong&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h3 class=&quot;dtH1&quot;&gt;Little Details&lt;/h3&gt;Unfortunately, at this point, it&#39;s necessary to pull back the covers  on ClickOnce deployment just a bit, and talk about what&#39;s going on  behind the scenes. When you publish your application to a website, it  will create on the Web server a folder like the one shown in Figure&amp;nbsp;5.&lt;br /&gt;  &lt;div class=&quot;fig&quot;&gt;&lt;img alt=&quot;Aa697430.autoupdatvb6apps05(en-US,VS.80).gif&quot; id=&quot;autoupdatvb6apps05&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC15335.gif&quot; title=&quot;Aa697430.autoupdatvb6apps05(en-US,VS.80).gif&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 5. Files published to the Web folder&lt;/strong&gt;&lt;/div&gt;You&#39;ll notice some files with an .application extension. If you drill  into the MyApplicationLauncher_1_0_0_0 folder, youll also find files  with .deploy and .manifest extensions. By default, Internet Information  Server doesn&#39;t correctly serve these up, and as a result, if someone  tries to install the application through the Web, it won&#39;t work. There&#39;s  a one-time change that you need to make to Internet Information  Server&#39;s settings so that it correctly supports ClickOnce deployment.&lt;br /&gt;  &lt;h3 class=&quot;dtH1&quot;&gt;Configuring Internet Information Server&lt;/h3&gt;On Windows XP, the following steps will correctly configure IIS. If  you&#39;re running on a different operating system, the steps will vary  slightly.  &lt;br /&gt;&lt;ol&gt;&lt;li&gt;Click the &lt;strong&gt;Start&lt;/strong&gt; menu, and then click &lt;strong&gt;Control Panel&lt;/strong&gt;. Then, open &lt;strong&gt;Administrative Tools&amp;nbsp;&amp;gt; Internet Information Services&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Expand the local computer name, expand &lt;strong&gt;Web Sites,&lt;/strong&gt; right-click &lt;strong&gt;Default Web Site&lt;/strong&gt;, and click &lt;strong&gt;Properties&lt;/strong&gt; (see Figure&amp;nbsp;6). &lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;Aa697430.autoupdatvb6apps06(en-US,VS.80).gif&quot; id=&quot;autoupdatvb6apps06&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC141061.gif&quot; title=&quot;Aa697430.autoupdatvb6apps06(en-US,VS.80).gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 6. Selecting Default Web Site Properties&lt;/strong&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;Properties&lt;/strong&gt; dialog box, click the &lt;strong&gt;HTTP Headers&lt;/strong&gt; tab, and then click &lt;strong&gt;File Types&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;File Types&lt;/strong&gt; dialog box, add the file types shown in Figure&amp;nbsp;7. &lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;Aa697430.autoupdatvb6apps07(en-US,VS.80).gif&quot; id=&quot;autoupdatvb6apps07&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC73607.gif&quot; title=&quot;Aa697430.autoupdatvb6apps07(en-US,VS.80).gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 7. Configuring file extensions for ClickOnce deployment&lt;/strong&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;Return to the Web installation page shown in Figure&amp;nbsp;4, and click &lt;strong&gt;Install&lt;/strong&gt;. The application installer will download and run, and the &lt;strong&gt;Application Install &lt;/strong&gt;–&lt;strong&gt; Security Warning&lt;/strong&gt; dialog box will appear (see Figure&amp;nbsp;8).  &lt;br /&gt;&lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;Aa697430.autoupdatvb6apps08(en-US,VS.80).gif&quot; id=&quot;autoupdatvb6apps08&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC129575.gif&quot; title=&quot;Aa697430.autoupdatvb6apps08(en-US,VS.80).gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 8. Prompt for application install&lt;/strong&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;Click &lt;strong&gt;Install&lt;/strong&gt;. The application will install and run. &lt;/li&gt;&lt;/ol&gt;&lt;h2 class=&quot;dtH1&quot;&gt;ClickOnce Deploying a Visual Basic 6.0 Application&lt;/h2&gt;With a basic knowledge of ClickOnce in hand, you can easily include  other files in your deployment. In the following steps, you will include  a Visual Basic 6.0 application as part of your ClickOnce deployment,  and you will configure the launcher application to start the Visual  Basic 6.0 application after it ensures that the latest version is  installed.  &lt;br /&gt;&lt;ol&gt;&lt;li&gt;Start Visual Basic 6.0.&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;New Project&lt;/strong&gt; dialog box, select &lt;strong&gt;Standard Exe&lt;/strong&gt;, and click &lt;strong&gt;Open&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Change the caption property of Form1 to &lt;strong&gt;VB6 App&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;From the toolbox, add a &lt;strong&gt;Command&lt;/strong&gt; button to Form1.&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;Click&lt;/strong&gt; event of the &lt;strong&gt;Command&lt;/strong&gt; button, enter the following code: &lt;pre class=&quot;code&quot;&gt;Private Sub Command1_Click()&lt;br /&gt;    MsgBox &quot;Hello World from VB6&quot;&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Click the &lt;strong&gt;File&lt;/strong&gt; menu, and then click &lt;strong&gt;Save Project As&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Save the project in the same folder as the MyAppLauncher.vbproj file.&lt;/li&gt;&lt;li&gt;Click the &lt;strong&gt;File&lt;/strong&gt; menu, and then click &lt;strong&gt;Make Project1.exe&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;Make Project&lt;/strong&gt; dialog box, click &lt;strong&gt;OK&lt;/strong&gt;. You now have a simple Visual Basic application that can be ClickOnce deployed along with your Visual Basic .NET launcher. &lt;/li&gt;&lt;li&gt;Switch to Visual Basic Express.&lt;/li&gt;&lt;li&gt;Click the &lt;strong&gt;Project&lt;/strong&gt; menu, and then click &lt;strong&gt;Add existing item&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;Add Existing Item&lt;/strong&gt; dialog box, in the &lt;strong&gt;File Types&lt;/strong&gt; drop-down list, click All &lt;strong&gt;Files (*.*)&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Select &lt;strong&gt;Project1.exe&lt;/strong&gt;, and click &lt;strong&gt;Add&lt;/strong&gt;. If you don&#39;t see Project1.exe, ensure that you saved your Visual Basic 6 project to the correct folder in Step 7. &lt;/li&gt;&lt;li&gt;In the Solution Explorer, select &lt;strong&gt;Project1.exe&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Press F4 to view the Properties window.&lt;/li&gt;&lt;li&gt;In the Properties window, set the &lt;strong&gt;Copy to Output&lt;/strong&gt; property to &lt;strong&gt;Copy if newer&lt;/strong&gt;. By adding the Visual Basic 6 executable to your Visual Basic .NET  solution, and indicating that you want it copied to the output, you are  ensuring that the Visual Basic 6 application will be included in your  ClickOnce deployment. The only remaining task is to modify the launcher  application so that it will launch the Visual Basic 6 application. &lt;/li&gt;&lt;li&gt;In the Solution Explorer, double-click &lt;strong&gt;Form1.vb&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Double-click &lt;strong&gt;Form1 &lt;/strong&gt;in the designer to switch to code view. You should be in the &lt;strong&gt;Form1_Load&lt;/strong&gt; event handler. &lt;/li&gt;&lt;li&gt;Enter the following lines of code in &lt;strong&gt;Form1_Load&lt;/strong&gt;: &lt;pre class=&quot;code&quot;&gt;Process.Start(&quot;Project1.exe&quot;)&lt;br /&gt;Me.Close()&lt;br /&gt;&lt;/pre&gt;You can now publish the new version of the application. This time,  the Visual Basic 6 application will be included with your launcher. &lt;/li&gt;&lt;li&gt;In the Solution Explorer, double-click &lt;strong&gt;My Project&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Click the &lt;strong&gt;Publish&lt;/strong&gt; tab.&lt;/li&gt;&lt;li&gt;Click &lt;strong&gt;Publish Now&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;When the MyAppLauncher Web page appears, click &lt;strong&gt;Install&lt;/strong&gt;. The Visual Basic 6 application, deployed through ClickOnce, should appear as shown in Figure&amp;nbsp;9.  &lt;br /&gt;&lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;Aa697430.autoupdatvb6apps09(en-US,VS.80).gif&quot; id=&quot;autoupdatvb6apps09&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC89244.gif&quot; title=&quot;Aa697430.autoupdatvb6apps09(en-US,VS.80).gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 9. Visual Basic 6 application deployed through ClickOnce&lt;/strong&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h2 class=&quot;dtH1&quot;&gt;Versioning&lt;/h2&gt;Now that you&#39;ve completed the initial deployment of your Visual Basic  6 application, deploying a new version becomes simple. Essentially, you  make changes to your Visual Basic 6 application, republish it, and  that&#39;s it. The following steps will walk you through the details:  &lt;br /&gt;&lt;ol&gt;&lt;li&gt;Switch to Visual Basic 6.0.&lt;/li&gt;&lt;li&gt;In the Project Explorer, double-click &lt;strong&gt;Form1.vb&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Set the &lt;strong&gt;BackColor&lt;/strong&gt; for Form1 to something obviously different, like &lt;strong&gt;red&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Click the &lt;strong&gt;File&lt;/strong&gt; menu, and then click &lt;strong&gt;Make project1.exe&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;In the &lt;strong&gt;Make Project&lt;/strong&gt; dialog box, click &lt;strong&gt;OK&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;When prompted to replace Project1.exe, click &lt;strong&gt;Yes&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Switch to Visual Basic Express.&lt;/li&gt;&lt;li&gt;In the Solution Explorer, double-click &lt;strong&gt;My Project&lt;/strong&gt;.&lt;/li&gt;&lt;li&gt;Click the &lt;strong&gt;Publish&lt;/strong&gt; tab.&lt;/li&gt;&lt;li&gt;Click &lt;strong&gt;Publish Now&lt;/strong&gt;. A new version has now been posted to the server. The next time the  user runs the application, the new version will automatically download,  install, and run. &lt;/li&gt;&lt;li&gt;Don&#39;t install MyAppLauncher through the Web page. Instead, just launch the existing version through the &lt;strong&gt;Start&lt;/strong&gt; menu. (Click the &lt;strong&gt;Start&lt;/strong&gt; menu, point to &lt;strong&gt;All Programs&lt;/strong&gt;, and then click &lt;strong&gt;MyAppLauncher&lt;/strong&gt;.)  Note that the dialog box shown in Figure&amp;nbsp;10 briefly appears.  &lt;br /&gt;&lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;Aa697430.autoupdatvb6apps10(en-US,VS.80).gif&quot; id=&quot;autoupdatvb6apps10&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC120719.gif&quot; title=&quot;Aa697430.autoupdatvb6apps10(en-US,VS.80).gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 10. Application automatically checking for a new version&lt;/strong&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;A new version is detected automatically, and you&#39;re prompted to install. &lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;Aa697430.autoupdatvb6apps11(en-US,VS.80).gif&quot; id=&quot;autoupdatvb6apps11&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC171488.gif&quot; title=&quot;Aa697430.autoupdatvb6apps11(en-US,VS.80).gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 11. Prompt to install the new version&lt;/strong&gt;&lt;/div&gt;&lt;/li&gt;&lt;li&gt;When you click &lt;strong&gt;OK&lt;/strong&gt;, the new version installs and runs. &lt;div class=&quot;fig1&quot;&gt;&lt;img alt=&quot;Aa697430.autoupdatvb6apps12(en-US,VS.80).gif&quot; id=&quot;autoupdatvb6apps12&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC137752.gif&quot; title=&quot;Aa697430.autoupdatvb6apps12(en-US,VS.80).gif&quot; /&gt; &lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 12. New version of the Visual Basic 6 application&lt;/strong&gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;h2 class=&quot;dtH1&quot;&gt;Conclusion&lt;/h2&gt;Hopefully, the technique shown in this article has opened a new door  for how you deploy some of your applications. In this first article, you  have learned how to deploy a Visual Basic 6 application through  ClickOnce deployment. Stay tuned for Part II, where you will learn how  to deploy COM object and ActiveX controls along with your Visual Basic 6  application.&lt;br /&gt;  &lt;br /&gt;  &lt;strong&gt;About the author&lt;/strong&gt; &lt;strong&gt;Scott Swigart&lt;/strong&gt; spends his time consulting, authoring,  and speaking about converging and emerging technologies. With  development experience going back over 15 years, and by staying in  constant contact with future software development technologies, Scott is  able to help organizations get the most out of today&#39;s technology while  preparing to leverage the technology of tomorrow. Scott is also the  author of several .NET books, a certified Microsoft trainer (MCT) and  developer (MCSD), and a Microsoft MVP. Feel free to contact the Scott at  &lt;a href=&quot;mailto:scott@swigartconsulting.com&quot;&gt;scott@swigartconsulting.com&lt;/a&gt;, or check out his latest musings at &lt;a href=&quot;http://blog.swigartconsulting.com/&quot;&gt;blog.swigartconsulting.com&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/121785868531715512/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/automatically-updating-visual-basic-6.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/121785868531715512'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/121785868531715512'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/automatically-updating-visual-basic-6.html' title='Automatically Updating Visual Basic 6 Applications: Part I'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-4632358900509096371</id><published>2017-03-14T11:11:00.003-07:00</published><updated>2017-03-14T11:11:44.547-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Enhancing a Visual Basic 6.0 Application with the ReportViewer Control</title><content type='html'>&lt;div class=&quot;topic&quot;&gt;  &lt;h1 class=&quot;title&quot;&gt;&lt;/h1&gt;&lt;div class=&quot;lw_vs&quot;&gt;    &lt;div id=&quot;curversion&quot;&gt;      &lt;strong&gt;                Visual Studio 2005             &lt;/strong&gt;    &lt;/div&gt;&lt;/div&gt;&lt;div id=&quot;mainSection&quot;&gt; &lt;div id=&quot;mainBody&quot;&gt;  &lt;span style=&quot;color: darkgrey;&quot;&gt; &lt;/span&gt; &lt;span id=&quot;changeHistory&quot;&gt; &lt;/span&gt; &lt;br /&gt; &lt;b&gt;Sales Support: A Hybrid Visual Basic 6.0 &amp;amp; Visual Basic 2005 Application, Part 3&lt;/b&gt; &lt;br /&gt; Scott Swigart&lt;br /&gt; February 2008&lt;br /&gt;  &lt;b&gt;Summary:&lt;/b&gt; This article, the third in a four-part series, shows how to include  modern, simple-to-configure Microsoft Visual Basic 2005 reporting  components within an existing Microsoft Visual Basic 6.0 application.  (13 printed pages)&lt;br /&gt; &lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Contents&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle0&quot;&gt;&lt;/a&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299496%28vs.80%29.aspx#HybridPartIII_topic1&quot;&gt;Introduction&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299496%28vs.80%29.aspx#HybridPartIII_topic2&quot;&gt;The Sales Support Application&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299496%28vs.80%29.aspx#HybridPartIII_topic3&quot;&gt;Reporting&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299496%28vs.80%29.aspx#HybridPartIII_topic4&quot;&gt;Application Architecture&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299496%28vs.80%29.aspx#HybridPartIII_topic5&quot;&gt;Visual Basic .NET Implementation&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299496%28vs.80%29.aspx#HybridPartIII_topic6&quot;&gt;Interoperability with Visual Basic 6.0&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299496%28vs.80%29.aspx#HybridPartIII_topic7&quot;&gt;Conclusion&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartIII_topic1&quot;&gt;&lt;/a&gt;&lt;h3 class=&quot;subHeading&quot;&gt;Introduction&lt;/h3&gt;&lt;div class=&quot;subSection&quot;&gt; Do  you want to modernize your Microsoft Visual Basic 6.0 applications?  Would you like to take advantage of Web services, desktop search, and  more, but you don&#39;t have the time or resources to upgrade (or rewrite)  your production applications in Microsoft Visual Basic 2005?&lt;br /&gt; In Part 1 of this article series, &lt;span class=&quot;unresolvedLink&quot;&gt;Enhancing an Application with Windows Desktop Search and Office Outlook Integratione&lt;/span&gt;,  I showed that it is not necessary to migrate a Visual Basic 6.0  application to Visual Basic 2005 in order to take advantage of .NET  functionality. Instead, you can integrate Microsoft Windows Desktop  Search into a Visual Basic 6.0 application by using COM objects that  have been created with Visual Basic 2005.&lt;br /&gt; In Part 2, &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299495%28v=vs.80%29.aspx&quot;&gt;Enhancing a Visual Basic 6.0 Application with MapPoint Web Service&lt;/a&gt;,  I demonstrated how to enhance the same application to display maps for  locations in an existing database by calling into Microsoft MapPoint Web  Service.&lt;br /&gt; This hybrid approach lets you take advantage of all of  the functionality of the .NET Framework without having to rewrite your  application.&lt;br /&gt; This article focuses on what is often an  afterthought to developers, but is top-of-mind to users: reporting  capabilities. Instead of struggling with the more limited reporting  capabilities of Visual Basic 6.0, you will see how to include modern,  simple-to-configure Visual Basic 2005 reporting components within an  existing Visual Basic 6.0 application.&lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartIII_topic2&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;The Sales Support Application&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle1&quot;&gt;&lt;/a&gt; &quot;Sales  Support&quot; is a very simple sales-force support application that allows  the user to look up accounts, contacts, and forecasted sales. The  application is not intended to be a complete sales-force automation  solution. Instead, it is designed to be a representative placeholder for  an existing line-of-business Visual Basic 6.0 application. Also, it  serves as the anchor for a number of logical application enhancements  that are best implemented by using Visual Basic 2005.&lt;br /&gt;  &lt;h3 class=&quot;subHeading&quot;&gt;Installation&lt;/h3&gt;&lt;div class=&quot;subSection&quot;&gt; The  Sales Support installer has been tested on Microsoft Windows XP SP2 and  on Windows Vista, and likely would work on older operating systems,  too. Because this is a hybrid Visual Basic 6.0 and Visual Basic 2005  application, the Sales Support installer will install the.NET Framework  2.0 as a prerequisite. This application also stores data in a back-end  database. For this reason, the installer will install Microsoft SQL  Server 2005 Express Edition, which replaces Microsoft SQL Server 2000  Desktop Engine (MSDE 2000).&lt;br /&gt; If you do not have these  prerequisites installed, the installer will download them for you  automatically. If they are already installed, the installer will detect  their presence and skip to the application installation.&lt;br /&gt; &lt;/div&gt;&lt;h3 class=&quot;subHeading&quot;&gt;Operation&lt;/h3&gt;&lt;div class=&quot;subSection&quot;&gt; After the application is installed, you can launch it from the &lt;b&gt;Start&lt;/b&gt; menu. Look for the Sales Support8_3 entry. The application will  initially prompt you to log on. To simplify use, the user name and  password fields default to working values, as shown in Figure 1. You can  just click the &lt;b&gt;Login&lt;/b&gt; button to continue.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC955.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 1. The Sales Support Login form&lt;/b&gt; &lt;br /&gt; After  you have logged on, the main application window appears, as shown in  Figure 2. The application provides three different views of the sales  information. The &lt;b&gt;Accounts&lt;/b&gt; tab provides the first view and shows  each account and associated sales information. This view can be sorted  differently by clicking on a column heading. The &lt;b&gt;Contacts&lt;/b&gt; tab provides the second view and shows more detailed information about each individual contact. The &lt;b&gt;Forecast&lt;/b&gt; tab provides the third view and displays future sales-forecast information.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC69754.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 2. The main application window&lt;/b&gt; &lt;br /&gt; Again,  the Sales Support application is not designed to be a working  sales-force solution. Instead, it serves only as a basis for realistic  application enhancements.&lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartIII_topic3&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Reporting&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle2&quot;&gt;&lt;/a&gt; Most  line-of-business applications are &quot;forms-over-data&quot; applications that  serve as a way to enter, edit, view, and visualize discrete pieces of  information that is stored in back-end databases. Of course, users also  want to see this data in the aggregate; for this reason, reports are a  key component of most line-of-business applications (although they often  are developed as an afterthought in version 1.0 of an application).  Reporting has been available for Visual Basic through options such as  Crystal Reports, the Data Environment, and a rich ecosystem of  third-party reporting tools.&lt;br /&gt; With Visual Studio 2005, Microsoft has released the powerful new &lt;b&gt;ReportViewer&lt;/b&gt; control, which allows you to create reports and view them in your application. The &lt;b&gt;ReportViewer&lt;/b&gt; control supports interactive reports, printing, layout control, and exporting options.&lt;br /&gt; To  add new reports to a Visual Basic 6.0 application, you could continue  to use the tools that shipped with the product in 1998. However, the  users of our fictional Sales Support application demand the &quot;latest and  greatest,&quot; so that the &lt;b&gt;ReportViewer&lt;/b&gt; control was the best choice.  This control can be added easily to a .NET form; also, by using the  Interop Forms Toolkit 2.0, this form can be launched from the existing  Visual Basic 6.0 application. Figure 3 shows the resulting report for  accounts.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC139044.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 3. Accounts report&lt;/b&gt; &lt;br /&gt; You can access this report in the sample application via the new &lt;b&gt;Reports&lt;/b&gt; menu item that includes Account, Contacts, and Forecast reports.&lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartIII_topic4&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Application Architecture&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle3&quot;&gt;&lt;/a&gt; The  core of the Sales Support application is a Visual Basic 6.0 application  that communicates with a SQL Server 2005 Express database. When the  user selects a report from the new &lt;b&gt;Reports&lt;/b&gt; menu, the Visual Basic  6.0 application creates an instance of the .NET report form as though  it were a COM object. The Visual Basic 6.0 application passes the report  data to the .NET report form as an ADO &lt;b&gt;Recordset&lt;/b&gt; object. The .NET report form converts the &lt;b&gt;Recordset&lt;/b&gt; object to a &lt;b&gt;DataSet&lt;/b&gt; object. This is necessary because the &lt;b&gt;ReportViewer&lt;/b&gt; control cannot bind to an ADO &lt;b&gt;Recordset&lt;/b&gt; object, but it can bind to an ADO.NET &lt;b&gt;DataSet&lt;/b&gt; object. The report is then displayed as shown in Figure 3. (For more information, please see &quot;&lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/bb407304%28vs.80%29.aspx&quot;&gt;Sharing ADO Recordsets Between Visual Basic 6.0 and Visual Basic 2005&lt;/a&gt;,&quot; in the MSDN Library.)&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC168840.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 4. Application data flow&lt;/b&gt; &lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartIII_topic5&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Visual Basic .NET Implementation&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle4&quot;&gt;&lt;/a&gt; Extending  the Visual Basic 6.0 Sales Support application requires a Visual Basic  .NET Framework Class Library project that is called VBNET_Extensions.  This project accepts a &lt;b&gt;Recordset&lt;/b&gt; object from the Visual Basic 6.0 Sales Support application and converts it to a &lt;b&gt;DataSet&lt;/b&gt; object that is suitable for reporting. The &lt;b&gt;DataSet&lt;/b&gt; object provides a visual designer that allows you to create table  definitions to hold the data. By looking at the designer, you can see  that this &lt;b&gt;DataSet&lt;/b&gt; object is configured with tables that map to the data that the Sales Support application will provide.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC161958.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 5. DataSet designer&lt;/b&gt; &lt;br /&gt; If you are completely new to the .NET Framework, a &lt;b&gt;DataSet&lt;/b&gt; object is a big change from the four main ADO objects—namely, &lt;b&gt;Recordset&lt;/b&gt; objects. A &lt;b&gt;DataSet&lt;/b&gt; object could be described as a collection of hierarchically related &lt;b&gt;Recordset&lt;/b&gt; objects (&lt;b&gt;DataTables&lt;/b&gt;), disconnected from the database, but accompanied by associated &lt;b&gt;Command&lt;/b&gt; objects to handle data manipulation within the database. What is yet more interesting, a &lt;b&gt;DataSet&lt;/b&gt; object can be filled with data from sources other than a database. In this example, the &lt;b&gt;DataSet&lt;/b&gt; object is filled with data from ADO &lt;b&gt;Recordset&lt;/b&gt; objects.&lt;br /&gt; The  Contacts, Account, and Forecast tables hold data that is supplied from  the Sales Support Visual Basic 6.0 application. The Visual Basic 6.0  application passes in &lt;b&gt;Recordset&lt;/b&gt; objects that contain this information, and the VBNET_Extensions Class Library copies that data from the &lt;b&gt;Recordset&lt;/b&gt; object into these &lt;b&gt;DataTable&lt;/b&gt; objects. The TopAccounts and TopForecast tables are designed  specifically for charts that appear in some of the reports. These charts  show the top 10 accounts, in terms of recent sales and forecast sales.&lt;br /&gt; After the &lt;b&gt;DataSet&lt;/b&gt; is created, you&#39;re ready to create the actual reports. Many reporting  options have been available for Visual Basic; however, with Visual  Studio 2005, Microsoft has introduced the &lt;b&gt;ReportViewer&lt;/b&gt; control,  which is an all-in-one reporting tool that simplifies the building of  powerful and interactive reports. This is a .NET control, of course, so  that it has to be placed on a .NET form that is launched from the  existing Visual Basic 6.0 application.&lt;br /&gt; Creating a .NET form that  is accessible from Visual Basic 6.0 requires the Interop Forms Toolkit  2.0, which is a free and supported Visual Basic 2005 PowerPack that  makes .NET forms appear as COM objects in Visual Basic 6.0 applications.  After you install it, a Visual Basic 6.0 InteropForm is added to the  Visual Basic .NET Framework Class Library, as shown in Figure 6.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC6158.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 6. Adding a Visual Basic 6.0 InteropForm&lt;/b&gt; &lt;br /&gt; The  InteropForm is just like any other .NET form, except that it contains a  few extra items that make it COM-callable. After the form has been  added to the project, place a &lt;b&gt;ReportViewer&lt;/b&gt; control from the Data section of the toolkit onto the form. The &lt;b&gt;ReportViewer&lt;/b&gt; control has a small smart tag in the top-right corner that is used to dock the &lt;b&gt;ReportViewer&lt;/b&gt; control in the form. Docking a control will cause the control to fill  the available space, and resize automatically as the form is resized—a  challenging task in Visual Basic 6.0. The smart tag is used also to  create a new report definition. You can see the smart tag accessed in  Figure 7.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC18829.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 7. Creating a new report from the smart tag&lt;/b&gt; &lt;br /&gt; With  the report designer open, the toolkit updates to contain a number of  items that are specific to reports. For this application, tables and  charts are the two main items that are used. Drag a table from the  toolkit onto the report-design surface. As soon as the table is in  place, drag individual columns from the Data View window onto the table  to bind table cells to the &lt;b&gt;DataSet&lt;/b&gt; columns, as shown in Figure 8.  You can also drag columns onto the chart to specify from where the data  values and category names should come.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC35993.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 8. Building the report&lt;/b&gt; &lt;br /&gt; To make the report more readable, set the &lt;b&gt;BackgroundColor&lt;/b&gt; property of the table cells to the expression &lt;b&gt;=iif(RowNumber(Nothing) Mod 2, &quot;PaleGreen&quot;, &quot;White&quot;)&lt;/b&gt;, which will alternate the background color of each line of the table. Right-click the chart, and then select &lt;b&gt;Properties&lt;/b&gt; to display the custom property pages for the chart, as shown in Figure  9. These property pages allow you to customize the chart—for example, by  setting the chart title, or by formatting the x-axis labels as  currency.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC19301.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 9. Chart-property pages&lt;/b&gt; &lt;br /&gt; The final step is to connect the &lt;b&gt;ReportViewer&lt;/b&gt; control to the &lt;b&gt;SalesSupportDataSet&lt;/b&gt;.&lt;br /&gt; To interact with the Sales Support Visual Basic 6.0 application, the application requires a way to pass a &lt;b&gt;Recordset&lt;/b&gt; object into the AccountReportForm. This step is accomplished by exposing a property on the report form, as shown in Listing 1.&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-1&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_faeb8fa0-24f4-4a48-849f-f52c85fd82db&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    Private mRecordset As Object&lt;br /&gt;    &amp;lt;InteropFormProperty()&amp;gt; _&lt;br /&gt;    Public Property Recordset() As Object&lt;br /&gt;        Get&lt;br /&gt;            Return mRecordset&lt;br /&gt;        End Get&lt;br /&gt;        Set(ByVal value As Object)&lt;br /&gt;            If (value IsNot mRecordset) Then&lt;br /&gt;                mRecordset = value&lt;br /&gt;                SalesSupportDataSet.Account.Clear()&lt;br /&gt;                Dim da As New OleDbDataAdapter()&lt;br /&gt;                da.Fill(SalesSupportDataSet.Account, mRecordset)&lt;br /&gt;                GenerateTopAccounts()&lt;br /&gt;                AccountReportViewer.RefreshReport()&lt;br /&gt;            End If&lt;br /&gt;        End Set&lt;br /&gt;    End Property&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;b&gt;Listing 1. Recordset property on the Visual Basic .NET form&lt;/b&gt; &lt;br /&gt; The property uses a .NET Framework &lt;b&gt;OleDbDataAdapter&lt;/b&gt; object to copy the contents of the &lt;b&gt;Recordset&lt;/b&gt; object into the &lt;b&gt;DataSet&lt;/b&gt;&#39;s Account &lt;b&gt;DataTable&lt;/b&gt; object, which was created earlier in the &lt;b&gt;DataSet&lt;/b&gt; designer. The magic of taking data from Visual Basic 6.0 and ADO and transferring it to an ADO.NET &lt;b&gt;DataSet&lt;/b&gt; comes in one line of code:&lt;br /&gt;                 da.Fill(SalesSupportDataSet.Account, mRecordset)&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-2&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_7d174ad4-d0cf-4c28-a271-33683a4a6c0a&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;      &lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The &lt;b&gt;DataAdapter&lt;/b&gt; does all of the work for you.&lt;br /&gt; Some of  the reports also include charts, which show &quot;top-10&quot; information. You  use a function to generate the data for these reports. For the Accounts  report, you accomplish this by using the &lt;b&gt;GenerateTopAccounts&lt;/b&gt; function that is shown in Listing 2.&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-3&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_f445b9e5-273e-453c-9dbe-0b36ff14d235&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    Private Sub GenerateTopAccounts()&lt;br /&gt;        Dim bs As New BindingSource(SalesSupportDataSet, _&lt;br /&gt;            SalesSupportDataSet.Account.TableName)&lt;br /&gt;&lt;br /&gt;        bs.Sort = SalesSupportDataSet.Account. _&lt;br /&gt;            sales_last_3_monthsColumn.ColumnName &amp;amp; _&lt;br /&gt;            &quot; asc&quot;&lt;br /&gt;&lt;br /&gt;        SalesSupportDataSet.TopAccounts.Clear()&lt;br /&gt;        For i As Integer = bs.Count - 11 To bs.Count - 1&lt;br /&gt;            Dim accountRow As SalesSupportDataSet.AccountRow&lt;br /&gt;            accountRow = bs.Item(i).Row&lt;br /&gt;            SalesSupportDataSet.TopAccounts. _&lt;br /&gt;                AddTopAccountsRow(accountRow.CompanyName, _&lt;br /&gt;                accountRow.sales_last_3_months)&lt;br /&gt;        Next&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;b&gt;Listing 2. GenerateTopAccounts function&lt;/b&gt; &lt;br /&gt; The &lt;b&gt;GenerateTopAccounts&lt;/b&gt; function uses a .NET Framework &lt;b&gt;BindingSource&lt;/b&gt; object to sort the accounts by sales. The first 10 rows are then copied from the &lt;b&gt;BindingSource&lt;/b&gt; object into the TopAccounts &lt;b&gt;DataTable&lt;/b&gt;. Because the chart already was bound to this table, the chart just populates itself and shows the top accounts.&lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartIII_topic6&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Interoperability with Visual Basic 6.0&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle5&quot;&gt;&lt;/a&gt; As  noted earlier, the Interop Forms Toolkit 2.0 allows you to build forms  in Visual Basic .NET that can be called from Visual Basic 6.0. The  Interop Forms Toolkit 2.0 installs a Visual Basic 6.0 InteropForm item  that was used to build the report forms. After the reports are created,  select &lt;b&gt;Tools&lt;/b&gt; | &lt;b&gt;Generate Interop Wrapper Classes&lt;/b&gt;, as shown in Figure 10, to generate COM wrappers that are needed for Visual Basic 6.0 to interact with the .NET form.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC53026.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 10. Generating COM wrapper classes&lt;/b&gt; &lt;br /&gt; After the wrapper classes are generated, compile the solution by using the &lt;b&gt;Build&lt;/b&gt; | &lt;b&gt;Build Solution&lt;/b&gt; menu command.&lt;br /&gt; With  the Sales Support application open in Visual Basic 6.0, add a reference  to the VBNET_Extensions COM object. Visual Basic 6.0 code can create an  instance of this object and call into it, as though it were any other  COM object. Listing 3 shows the Visual Basic 6.0 code that passes the  account data into the Visual Basic .NET report form.&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-4&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_6e111255-9601-4d3e-b3f5-bf6cb3921f48&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Private Sub mnuAccounts_Click()&lt;br /&gt;    Dim f As New VBNET_Extensions_AccountReportForm&lt;br /&gt;&lt;br /&gt;    If rsAccount Is Nothing Then&lt;br /&gt;        LoadAccountData&lt;br /&gt;    End If&lt;br /&gt;&lt;br /&gt;    f.Recordset = rsAccount&lt;br /&gt;    f.Show&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;b&gt;Listing 3. Passing a Recordset object into a Visual Basic .NET report form&lt;/b&gt; &lt;br /&gt; You can see that only a tiny amount of code was required in Visual Basic 6.0 to trigger the new Visual Basic .NET functionality.&lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartIII_topic7&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Conclusion&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle6&quot;&gt;&lt;/a&gt; Visual  Basic .NET is a great choice for many new application scenarios.  Microsoft continues to pour its efforts into enhancing the .NET  Framework and related technologies. At the same time, many organizations  are maintaining significant Visual Basic 6.0 applications. As this  article has shown, there is no reason that you cannot create hybrid  applications by using the best of both technologies.&lt;br /&gt;  &lt;div class=&quot;subSection&quot;&gt;  &lt;h4 class=&quot;subHeading&quot;&gt;About the author&lt;/h4&gt;&lt;div class=&quot;subSection&quot;&gt; Scott  Swigart spends his time consulting, authoring, and speaking about  converging and emerging technologies. With development experience going  back over 15 years, and by staying in constant contact with future  software-development technologies, Scott is able to help organizations  get the most out of today&#39;s technology while they prepare to leverage  the technology of tomorrow. Scott is also the author of several .NET  books, a certified Microsoft trainer (MCT) and developer (MCSD), and a  Microsoft MVP. Feel free to contact the Scott at &lt;a alt=&quot;&quot; href=&quot;mailto:scott@swigartconsulting.com&quot; target=&quot;_blank&quot;&gt;scott@swigartconsulting.com&lt;/a&gt;, or check out his latest musings at &lt;a href=&quot;http://blog.swigartconsulting.com/&quot;&gt;blog.swigartconsulting.com&lt;/a&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;</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/4632358900509096371/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/enhancing-visual-basic-60-application_14.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/4632358900509096371'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/4632358900509096371'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/enhancing-visual-basic-60-application_14.html' title='Enhancing a Visual Basic 6.0 Application with the ReportViewer Control'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-2363067636391318384</id><published>2017-03-14T11:08:00.004-07:00</published><updated>2017-03-14T11:08:37.938-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Enhancing a Visual Basic 6.0 Application with MapPoint Web Service</title><content type='html'>&lt;div class=&quot;topic&quot;&gt;  &lt;h1 class=&quot;title&quot;&gt;&lt;/h1&gt;&lt;div class=&quot;lw_vs&quot;&gt;    &lt;div id=&quot;curversion&quot;&gt;      &lt;strong&gt;                Visual Studio 2005             &lt;/strong&gt;    &lt;/div&gt;&lt;/div&gt;&lt;div id=&quot;mainSection&quot;&gt; &lt;div id=&quot;mainBody&quot;&gt;  &lt;span style=&quot;color: darkgrey;&quot;&gt; &lt;/span&gt; &lt;span id=&quot;changeHistory&quot;&gt; &lt;/span&gt; &lt;br /&gt; &lt;b&gt;Sales Support: A Hybrid Visual Basic 6.0 &amp;amp; Visual Basic 2005 Application, Part 2&lt;/b&gt; &lt;br /&gt; Scott Swigart&lt;br /&gt; February 2008&lt;br /&gt;  &lt;b&gt;Summary:&lt;/b&gt; This article, the second in a four-part series, demonstrates how to use  .NET functionality to expand and modernize a Microsoft Visual Basic 6.0  application by adding mapping capabilities via the Microsoft MapPoint  Web Service API. (14 printed pages)&lt;br /&gt; Click &lt;a href=&quot;http://download.microsoft.com/download/A/5/6/A56DD645-14AF-4CC2-BEC6-EEBE5B284167/installer.03.zip&quot;&gt;here&lt;/a&gt; to download the application installer.&lt;br /&gt; Click &lt;a href=&quot;http://download.microsoft.com/download/A/5/6/A56DD645-14AF-4CC2-BEC6-EEBE5B284167/source.03.zip&quot;&gt;here&lt;/a&gt; to download the application source code.&lt;br /&gt; &lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Contents&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle0&quot;&gt;&lt;/a&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299495%28vs.80%29.aspx#HybridPartII_topic1&quot;&gt;Introduction&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299495%28vs.80%29.aspx#HybridPartII_topic2&quot;&gt;The Sales Support Application&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299495%28vs.80%29.aspx#HybridPartII_topic3&quot;&gt;Customer-Mapping Enhancement&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299495%28vs.80%29.aspx#HybridPartII_topic4&quot;&gt;Application Architecture&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299495%28vs.80%29.aspx#HybridPartII_topic5&quot;&gt;Visual Basic 2005 Implementation&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299495%28vs.80%29.aspx#HybridPartII_topic6&quot;&gt;Interoperability with Visual Basic 6.0&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299495%28vs.80%29.aspx#HybridPartII_topic7&quot;&gt;Conclusion&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299495%28vs.80%29.aspx#HybridPartII_topic8&quot;&gt;Additional Resources&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartII_topic1&quot;&gt;&lt;/a&gt;&lt;h3 class=&quot;subHeading&quot;&gt;Introduction&lt;/h3&gt;&lt;div class=&quot;subSection&quot;&gt; Do  you want to modernize your Microsoft Visual Basic 6.0 applications?  Would you like to take advantage of Web services, desktop search, and  more, but you don&#39;t have the time or resources to upgrade (or rewrite)  your production applications in Microsoft Visual Basic 2005?&lt;br /&gt; In Part 1 of this article series, &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299499%28v=vs.80%29.aspx&quot;&gt;Enhancing an Application with Windows Desktop Search and Office Outlook Integration&lt;/a&gt;,  I showed that it is not necessary to migrate a Visual Basic 6.0  application to Visual Basic 2005 in order to take advantage of .NET  functionality. Instead, you can integrate Microsoft Windows Desktop  Search into a Visual Basic 6.0 application by using COM objects that  have been created with Visual Basic 2005. This approach lets you take  advantage of all of the functionality of the Microsoft .NET Framework  without having to rewrite your application.&lt;br /&gt; This article  demonstrates another practical example of using .NET functionality to  expand and modernize a Visual Basic 6.0 application—in this case, adding  mapping capabilities via the Microsoft MapPoint Web Service API.&lt;br /&gt; Of  course, the example is intended only to show you how to access MapPoint  Web Service from Visual Basic 6.0—not to show off everything that  MapPoint Web Service can do for your applications. How to make MapPoint  Web Service a part of your applications is up to you, but here are a few  ideas:&lt;br /&gt; &lt;ul&gt;&lt;li&gt;              You can add a feature to a sales-force automation  application that allows sales reps to specify which customers they plan  to visit on a particular day, and automatically generate driving  directions from one customer site to the next.&lt;br /&gt; &lt;/li&gt;&lt;li&gt;              Perhaps you work for a company that builds new homes, and  you manage an application that tracks potential real-estate investments.  You could use MapPoint Web Service to add a map of the area—including  schools, shops, and so forth—to forms and reports that document those  potential investments.&lt;br /&gt; &lt;/li&gt;&lt;li&gt;              Maybe you have to validate addresses. You could use  MapPoint Web Service to return possible matches to an address that you  have entered into your application.&lt;br /&gt; &lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartII_topic2&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;The Sales Support Application&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle1&quot;&gt;&lt;/a&gt; &quot;Sales  Support&quot; is a very simple sales-force support application that allows  the user to look up accounts, contacts, and forecasted sales. The  application is not intended to be a complete sales-force automation  solution. Instead, it is designed to be a representative placeholder for  an existing line-of-business Visual Basic 6.0 application. Also, it  serves as the anchor for a number of logical application enhancements  that are best implemented by using Visual Basic 2005.&lt;br /&gt;  &lt;h3 class=&quot;subHeading&quot;&gt;Installation&lt;/h3&gt;&lt;div class=&quot;subSection&quot;&gt; The  Sales Support installer has been tested on Microsoft Windows XP SP2 and  on Windows Vista, and likely would work on older operating systems,  too. Because this is a hybrid Visual Basic 6.0 and Visual Basic 2005  application, the Sales Support installer will install the.NET Framework  2.0 as a prerequisite. This application also stores data in a back-end  database. For this reason, the installer will install Microsoft SQL  Server 2005 Express Edition, which replaces Microsoft SQL Server 2000  Desktop Engine (MSDE 2000).&lt;br /&gt; If you do not have these  prerequisites installed, the installer will download them for you  automatically. If they are already installed, the installer will detect  their presence and skip to the application installation.&lt;br /&gt; &lt;/div&gt;&lt;h3 class=&quot;subHeading&quot;&gt;Operation&lt;/h3&gt;&lt;div class=&quot;subSection&quot;&gt; After the application is installed, you can launch it from the &lt;b&gt;Start&lt;/b&gt; menu. Look for the Sales Support8_3 entry. The application will  initially prompt you to log on. To simplify use, the user name and  password fields default to working values, as shown in Figure 1. You can  just click the &lt;b&gt;Login&lt;/b&gt; button to continue.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC955.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 1. The Sales Support Login form&lt;/b&gt; &lt;br /&gt; After  you have logged on, the main application window appears, as shown in  Figure 2. The application provides three different views of the sales  information. The Accounts tab provides the first view and shows each  account and associated sales information. This view can be sorted  differently by clicking on a column heading. The &lt;b&gt;Contacts&lt;/b&gt; tab provides the second view and shows more detailed information about each individual contact. The &lt;b&gt;Forecast&lt;/b&gt; tab provides the third view and displays future sales-forecast information.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC90330.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 2. The main application window&lt;/b&gt; &lt;br /&gt; Again,  the Sales Support application is not designed to be a working  sales-force solution. Instead, it serves only as a basis for realistic  application enhancements.&lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartII_topic3&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Customer-Mapping Enhancement&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle2&quot;&gt;&lt;/a&gt; Mapping  and geographic functionalities are becoming standard features of  line-of-business applications, whether they validate addresses or  provide driving directions for customer visits. In Visual Basic 6.0,  there is no built-in way to generate maps. Microsoft does provide  extensive mapping capabilities through MapPoint Web Service, but there’s  no easy way to call this service from Visual Basic 6.0. Calling  MapPoint Web Service from Visual Basic 2005, however, is almost trivial.  By using the extension that is described in this article, you can map a  customer location, as shown in Figure 3.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC164784.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 3. Mapping a customer location&lt;/b&gt; &lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartII_topic4&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Application Architecture&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle3&quot;&gt;&lt;/a&gt; The  core of the application is a Visual Basic 6.0 application that  communicates with a SQL Server 2005 Express database. When you click the  &lt;b&gt;Map&lt;/b&gt; button, the client address is passed to a Visual Basic 2005  form. The Visual Basic 2005 form communicates with MapPoint Web Service  to retrieve a map image for the address. The map is rendered on the  Visual Basic 2005 form, which also allows the user to zoom in and zoom  out.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC61939.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 4. Application data flow&lt;/b&gt; &lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartII_topic5&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Visual Basic 2005 Implementation&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle4&quot;&gt;&lt;/a&gt; For  some time, mapping capabilities have been available through Web sites,  many of which make it easy for a user to look up a location. However,  pulling maps into an application is more challenging. To use a typical  Web site, you would have to write code to download and parse the HTML;  if the site changed its layout, your application could easily break.&lt;br /&gt; Web  services offer an alternative to screen-scraping Web sites. Web  services are not intended to be used by a human being with a browser.  Instead, Web services take requests as XML over HTTP, and return results  as XML. Web services use the same infrastructure as Web sites, but  they’re designed specifically to communicate with applications—not with  people.&lt;br /&gt; By using Visual Studio 2005, communicating with Web  services is even easier. Visual Studio 2005 generates classes for you  that take care of creating and parsing the XML. You just create an  instance of a class, call a function, and get a result.&lt;br /&gt; In the  case of mapping data, a Web service makes perfect sense, because you  would not want to deploy worldwide detailed maps to every desktop, and  you would not want to have to keep that mapping data updated. Instead,  it would make much more sense just to retrieve the map for a specific  area, on demand. Microsoft MapPoint Web Service provides exactly that  capability.&lt;br /&gt; To begin using MapPoint Web Service, you have Visual  Studio 2005 download a definition file for the service and generate  client-side &quot;proxy&quot; classes. You do this through the &lt;b&gt;Project&lt;/b&gt; | &lt;b&gt;Add Web Reference&lt;/b&gt; menu command in Visual Studio 2005.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC27014.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 5. Adding a Web reference&lt;/b&gt; &lt;br /&gt; The  definition for a Web service is contained in a Web Services Description  Language (WSDL) document—in this case,  http://staging.mappoint.net/standard-30/mappoint.wsdl. Visual Studio  2005 downloads this WSDL document and generates a proxy class under a &lt;b&gt;MapPointService&lt;/b&gt; namespace.&lt;br /&gt;  &lt;h3 class=&quot;subHeading&quot;&gt;Looking up Addresses by Using MapPoint Web Service&lt;/h3&gt;&lt;div class=&quot;subSection&quot;&gt; After the Web reference has been added, you can begin writing code to make requests and process responses from the Web service.&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-1&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_104b5717-44b1-48d5-a774-40e376ba1f80&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Dim address As New MapPointService.Address()&lt;br /&gt;address.FormattedAddress = Me.Address&lt;br /&gt;&lt;br /&gt;Dim findOptions As New MapPointService.FindOptions()&lt;br /&gt;findOptions.ThresholdScore = 0&lt;br /&gt;&lt;br /&gt;Dim findAddressSpec As New MapPointService.FindAddressSpecification&lt;br /&gt;With findAddressSpec&lt;br /&gt;    .InputAddress = address&lt;br /&gt;    .DataSourceName = &quot;MapPoint.NA&quot;&lt;br /&gt;    .Options = findOptions&lt;br /&gt;End With&lt;br /&gt;&lt;br /&gt;findService.Credentials = credentials&lt;br /&gt;findResults = findService.FindAddress(findAddressSpec)&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;b&gt;Listing 1. Looking up an address in MapPoint Web Service&lt;/b&gt; &lt;br /&gt; The  first step in using MapPoint Web Service is to find the latitude and  longitude for an address. You begin by creating an instance of the &lt;b&gt;Address&lt;/b&gt; class. This class was automatically generated when the Web service was referenced. You set the &lt;b&gt;FormattedAddress&lt;/b&gt; property to the text address that you want to look up.&lt;br /&gt; When you search for an address, multiple possible matches could be returned if the address is not exactly matched. The &lt;b&gt;ThresholdScore&lt;/b&gt; property of the &lt;b&gt;FindOptions&lt;/b&gt; class lets you control how closely an address must match to be returned. Regardless of the &lt;b&gt;ThresholdScore&lt;/b&gt; value, address matches are returned in order from best to worst.&lt;br /&gt; The address and options are then linked to a &lt;b&gt;FindAddressSpecification&lt;/b&gt;.  In addition, the specification lets you specify which data source you  want to search. For example, you can search North America, Europe, or  other data sources.&lt;br /&gt; To communicate with MapPoint Web Service, you  must specify credentials. In this example, the application is  connecting to the MapPoint Web Service staging service, not to the  production Web service, so that developer credentials will suffice. (For  your convenience, I&#39;ve hard-coded credentials into the application. If  those credentials stop working at some future date, you can apply for  your own developer credentials at &lt;a href=&quot;https://mappoint-css.partners.extranet.microsoft.com/MwsSignup/Eval2.aspx&quot;&gt;https://mappoint-css.partners.extranet.microsoft.com/MwsSignup/Eval2.aspx&lt;/a&gt;.)&lt;br /&gt; At  this point, you have configured the information that is necessary for  MapPoint Web Service to look up the address and return latitude and  longitude information—key inputs for any mapping service. When the &lt;b&gt;FindAddress&lt;/b&gt; method of &lt;b&gt;findService&lt;/b&gt; is called, the request is packaged as XML and sent over the Internet to  MapPoint Web Service. The results are obtained, and they are returned  as XML. The proxy class, which is created by Visual Studio 2005, parses  the XML and returns the results in the &lt;b&gt;findResults&lt;/b&gt; object.&lt;br /&gt; &lt;/div&gt;&lt;h3 class=&quot;subHeading&quot;&gt;Requesting a Map from MapPoint Web Service&lt;/h3&gt;&lt;div class=&quot;subSection&quot;&gt; Now, you&#39;re ready to request a map image for the address. You accomplish this by using the code that is shown in Listing 2.&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-2&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_6e828e64-3ecc-4d79-b27d-ca8af59c19cc&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;&#39; Set the centerpoint on and scale of&lt;br /&gt;&#39; the map location you want to display&lt;br /&gt;Dim mapViews(0) As ViewByScale&lt;br /&gt;mapViews(0) = New ViewByScale&lt;br /&gt;With mapViews(0)&lt;br /&gt;    .CenterPoint = Me.findResults.Results(0).FoundLocation.LatLong&lt;br /&gt;    .MapScale = ZoomScrollBar.Value * ZoomScrollBar.Value&lt;br /&gt;End With&lt;br /&gt;&lt;br /&gt;&#39; Add a pushpin to the map&lt;br /&gt;Dim pushPins(0) As Pushpin&lt;br /&gt;pushPins(0) = New Pushpin&lt;br /&gt;With pushPins(0)&lt;br /&gt;    .PinID = &quot;pin0&quot;&lt;br /&gt;    .Label = PushPinName&lt;br /&gt;    .IconName = &quot;0&quot;&lt;br /&gt;    .IconDataSource = &quot;MapPoint.Icons&quot;&lt;br /&gt;    .LatLong = mapViews(0).CenterPoint&lt;br /&gt;End With&lt;br /&gt;&lt;br /&gt;&#39; Customize the map display options&lt;br /&gt;Dim options As New MapOptions&lt;br /&gt;With options&lt;br /&gt;    .Format = New ImageFormat&lt;br /&gt;    .Format.Height = PictureBox1.Height&lt;br /&gt;    .Format.Width = PictureBox1.Width&lt;br /&gt;End With&lt;br /&gt;&lt;br /&gt;Dim mapSpec As New MapSpecification&lt;br /&gt;With mapSpec&lt;br /&gt;    .Views = mapViews&lt;br /&gt;    .Options = options&lt;br /&gt;    .DataSourceName = &quot;MapPoint.NA&quot;&lt;br /&gt;    .Pushpins = pushPins&lt;br /&gt;    .HideEntityTypes = New String() {&quot;School&quot;}&lt;br /&gt;End With&lt;br /&gt;&lt;br /&gt;&#39; Retrieve the map image&lt;br /&gt;renderService.Credentials = credentials&lt;br /&gt;Dim mapImages() As MapImage = renderService.GetMap(mapSpec)&lt;br /&gt;&lt;br /&gt;PictureBox1.Image = New System.Drawing.Bitmap(New _&lt;br /&gt;    System.IO.MemoryStream(mapImages(0).MimeData.Bits))&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;b&gt;Listing 2. Requesting a map for the address&lt;/b&gt; &lt;br /&gt; There are a number of objects that must be sent to request a map image. First, you create a &lt;b&gt;ViewByScale&lt;/b&gt; object. The &lt;b&gt;CenterPoint&lt;/b&gt; property is set to the latitude and longitude of the address that was previously retrieved. Next, you set the &lt;b&gt;MapScale&lt;/b&gt; property. This controls how zoomed in or zoomed out the map is. In this  application, this value is controlled by a scroll bar, so that the user  can control the zoom level. In addition, it works better to change this  value logarithmically instead of linearly, so that the value of the  scroll bar is squared when you set the &lt;b&gt;MapScale&lt;/b&gt; property (otherwise, zooming out could take a very long time).&lt;br /&gt; To create a label on the map by using the business name, you create pushpins. You use the &lt;b&gt;Label&lt;/b&gt; property to specify the text that you want, and the &lt;b&gt;Icon&lt;/b&gt; property to specify the icon to appear on the map. Next, you create an instance of a &lt;b&gt;MapOptions&lt;/b&gt; class, and set properties to define the height and width of the image  that you want returned. This information is all connected to a &lt;b&gt;MapSpecification&lt;/b&gt; object, and sent to the MapPoint Web Service &lt;b&gt;RenderService&lt;/b&gt;. The &lt;b&gt;RenderService&lt;/b&gt; generates an image of the requested area, and returns the image (encoded in XML) back to the application.&lt;br /&gt; Again,  the application parses the XML and returns the data. There&#39;s just one  small bit of conversion to convert the image data to an actual &lt;b&gt;BitMap&lt;/b&gt; data type, and then the image can be displayed in a &lt;b&gt;PictureBox&lt;/b&gt;. The results are rendered as shown in Figure 3.&lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartII_topic6&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Interoperability with Visual Basic 6.0&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle5&quot;&gt;&lt;/a&gt; Now,  you have .NET code with mapping capability. However, how do you tie  that to your existing Visual Basic 6.0 application? The answer is: You  use the Interop Forms Toolkit 2.0 () to create a Visual Basic 2005 form  that can easily be called from Visual Basic 6.0. When you install the  Interop Forms Toolkit 2.0 into Visual Studio 2005, it provides a new  Visual Basic 6.0 InteropForm item type that you can add to your  projects. This is a .NET form that is easily callable from Visual Basic  6.0.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC109410.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 6. Adding a Visual Basic 6.0 InteropForm item type&lt;/b&gt; &lt;br /&gt; The  InteropForm is a standard .NET form that contains a number of  attributes that control which portions of the form are COM-callable.  Listing 3 shows a section of this form code.&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-3&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_7a472f7b-ec3d-4538-87cd-0032ee707534&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Imports System.Windows.Forms&lt;br /&gt;Imports Microsoft.InteropFormTools&lt;br /&gt;Imports VBNET_Extensions.MapPointService&lt;br /&gt;&lt;br /&gt;&amp;lt;InteropForm()&amp;gt; _&lt;br /&gt;Public Class MapPointForm&lt;br /&gt;    Private findResults As FindResults&lt;br /&gt;    Private renderService As New RenderServiceSoap&lt;br /&gt;    Private findService As New FindServiceSoap&lt;br /&gt;&lt;br /&gt;    Private isInitialized As Boolean = False&lt;br /&gt;&lt;br /&gt;    Private m_address As String&lt;br /&gt;    &amp;lt;InteropFormProperty()&amp;gt; _&lt;br /&gt;    Public Property Address() As String&lt;br /&gt;        Get&lt;br /&gt;            Return m_address&lt;br /&gt;        End Get&lt;br /&gt;        Set(ByVal value As String)&lt;br /&gt;            If value &amp;lt;&amp;gt; m_address Then&lt;br /&gt;                m_address = value&lt;br /&gt;                findResults = Nothing&lt;br /&gt;                RenderTimer.Enabled = True&lt;br /&gt;            End If&lt;br /&gt;        End Set&lt;br /&gt;    End Property&lt;br /&gt;    &lt;br /&gt;    ...&lt;br /&gt;&lt;br /&gt;End Class&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;b&gt;Listing 3. Visual Basic 6.0 InteropForm item type&lt;/b&gt; &lt;br /&gt; The form contains an &lt;b&gt;InteropForm&lt;/b&gt; attribute, and any properties or methods that you want to make  available to Visual Basic 6.0 are also decorated with an attribute, such  as the &lt;b&gt;InteropFormProperty&lt;/b&gt; and &lt;b&gt;InteropFormMethod&lt;/b&gt; attributes.&lt;br /&gt; There are two steps to compiling your Visual Basic 2005 COM objects. First, you select the &lt;b&gt;Tools &lt;/b&gt;| &lt;b&gt;Generate InteropForm Wrapper Classes&lt;/b&gt; menu command. This generates COM wrapper code that is based on your attributes. Then, you just build the project by using the &lt;b&gt;Build&lt;/b&gt; | &lt;b&gt;Build Solution&lt;/b&gt; menu command.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC170778.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 7. Generating the InteropForm wrapper classes&lt;/b&gt; &lt;br /&gt;  &lt;h3 class=&quot;subHeading&quot;&gt;Calling the .NET Form from Visual Basic 6.0&lt;/h3&gt;&lt;div class=&quot;subSection&quot;&gt; After  you have created an interoperable form, you can call it from Visual  Basic 6.0, as with any other COM object. From Visual Basic 6.0, you can  just add a reference to your Visual Basic 2005 code.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC61070.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 8. Referencing a Visual Basic 2005 component from Visual Basic 6.0&lt;/b&gt; &lt;br /&gt; As  soon as the component is referenced, you can create an instance of your  Visual Basic 2005 form, set properties, and perform other operations.&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-4&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_e7308f11-7445-433a-beb5-a46597a52fcf&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Private Sub cmdMap_Click()&lt;br /&gt;    Dim frmMap As VBNET_Extensions_MapPointForm&lt;br /&gt;    Set frmMap = New VBNET_Extensions_MapPointForm&lt;br /&gt;    &lt;br /&gt;    frmMap.Address = rsAccount(&quot;Address&quot;) &amp;amp; &quot;, &quot; &amp;amp; _&lt;br /&gt;        rsAccount(&quot;City&quot;) &amp;amp; &quot;, &quot; &amp;amp; _&lt;br /&gt;        rsAccount(&quot;Region&quot;) &amp;amp; &quot;  &quot; &amp;amp; _&lt;br /&gt;        rsAccount(&quot;PostalCode&quot;)&lt;br /&gt;    &lt;br /&gt;    frmMap.PushPinName = rsAccount(&quot;CompanyName&quot;)&lt;br /&gt;    frmMap.Show&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;b&gt;Listing 4. Calling into a Visual Basic 2005 form from Visual Basic 6.0&lt;/b&gt; &lt;br /&gt; Here, customer data from the database is passed to the &lt;b&gt;Address&lt;/b&gt; property of the form. The &lt;b&gt;PushPinName&lt;/b&gt; property is set to the company name, which will cause the company name  to appear on the map image. Finally, the form is shown displaying the  map.&lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartII_topic7&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Conclusion&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle6&quot;&gt;&lt;/a&gt; If  you have applications that are written in Visual Basic 6.0, you can  preserve those investments, and just extend them by using Visual Basic  2005. In this article, I showed how to call a Web service via Visual  Basic 2005 and add MapPoint Web Service functionality to a Visual Basic  6.0 application.&lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartII_topic8&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Additional Resources&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle7&quot;&gt;&lt;/a&gt; For more information on using MapPoint Web Service, check out the following links:&lt;br /&gt; &lt;ul&gt;&lt;li&gt;          MapPoint Web Service Resources/Virtual Earth Developer Center&lt;a href=&quot;https://msdn.microsoft.com/mappoint/&quot;&gt;http://msdn.microsoft.com/mappoint/&lt;/a&gt;&lt;br /&gt; &lt;/li&gt;&lt;li&gt;          MapPoint Web Service Technical Articles&lt;br /&gt;  &lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/bb507685.aspx&quot;&gt;bb507685&lt;/a&gt; &lt;br /&gt; &lt;/li&gt;&lt;li&gt;          MSDN Library&lt;br /&gt;          &quot;&lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/aa492550.aspx&quot;&gt;Getting Started with the MapPoint Web Service SDK&lt;/a&gt;&quot;&lt;br /&gt; &lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;subSection&quot;&gt;  &lt;h4 class=&quot;subHeading&quot;&gt;About the author&lt;/h4&gt;&lt;div class=&quot;subSection&quot;&gt; Scott  Swigart spends his time consulting, authoring, and speaking about  converging and emerging technologies. With development experience going  back over 15 years, and by staying in constant contact with future  software-development technologies, Scott is able to help organizations  get the most out of today&#39;s technology while they prepare to leverage  the technology of tomorrow. Scott is also the author of several .NET  books, a certified Microsoft trainer (MCT) and developer (MCSD), and a  Microsoft MVP. Feel free to contact the Scott at &lt;a alt=&quot;&quot; href=&quot;mailto:scott@swigartconsulting.com&quot; target=&quot;_blank&quot;&gt;scott@swigartconsulting.com&lt;/a&gt;, or check out his latest musings at &lt;a href=&quot;http://blog.swigartconsulting.com/&quot;&gt;blog.swigartconsulting.com&lt;/a&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;</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/2363067636391318384/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/enhancing-visual-basic-60-application.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/2363067636391318384'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/2363067636391318384'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/enhancing-visual-basic-60-application.html' title='Enhancing a Visual Basic 6.0 Application with MapPoint Web Service'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-1173309246115071736</id><published>2017-03-14T11:05:00.003-07:00</published><updated>2017-03-14T11:05:39.226-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Enhancing an Application with Windows Desktop Search and Office Outlook Integration</title><content type='html'>&lt;div class=&quot;topic&quot;&gt;  &lt;h1 class=&quot;title&quot;&gt;&lt;/h1&gt;&lt;div class=&quot;lw_vs&quot;&gt;    &lt;div id=&quot;curversion&quot;&gt;      &lt;strong&gt;                Visual Studio 2005             &lt;/strong&gt;    &lt;/div&gt;&lt;/div&gt;&lt;div id=&quot;mainSection&quot;&gt; &lt;div id=&quot;mainBody&quot;&gt;  &lt;span style=&quot;color: darkgrey;&quot;&gt; &lt;/span&gt; &lt;span id=&quot;changeHistory&quot;&gt; &lt;/span&gt; &lt;br /&gt; &lt;b&gt;Sales Support: A Hybrid Visual Basic 6.0 &amp;amp; Visual Basic 2005 Application, Part 1&lt;/b&gt; &lt;br /&gt; Scott Swigart&lt;br /&gt; February 2008&lt;br /&gt;  &lt;b&gt;Summary:&lt;/b&gt; This article, the first in a four-part series, shows that it is not  necessary to migrate a Microsoft Visual Basic 6.0 application to  Microsoft Visual Basic 2005 in order to take advantage of .NET  functionality. (15 printed pages)&lt;br /&gt; Click &lt;a href=&quot;http://download.microsoft.com/download/A/5/6/A56DD645-14AF-4CC2-BEC6-EEBE5B284167/installer.03.zip&quot;&gt;here&lt;/a&gt; to download the application installer.&lt;br /&gt; Click &lt;a href=&quot;http://download.microsoft.com/download/A/5/6/A56DD645-14AF-4CC2-BEC6-EEBE5B284167/source.03.zip&quot;&gt;here&lt;/a&gt; to download the application source code.&lt;br /&gt; &lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Contents&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle0&quot;&gt;&lt;/a&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299499%28vs.80%29.aspx#HybridPartI_topic1&quot;&gt;Introduction&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299499%28vs.80%29.aspx#HybridPartI_topic2&quot;&gt;The Sales Support Application&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299499%28vs.80%29.aspx#HybridPartI_topic3&quot;&gt;Windows Desktop Search Enhancement&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299499%28vs.80%29.aspx#HybridPartI_topic4&quot;&gt;Application Architecture&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299499%28vs.80%29.aspx#HybridPartI_topic5&quot;&gt;Visual Basic 2005 Implementation&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299499%28vs.80%29.aspx#HybridPartI_topic6&quot;&gt;Visual Basic 6.0 Implementation&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299499%28vs.80%29.aspx#HybridPartI_topic7&quot;&gt;Conclusion&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299499%28vs.80%29.aspx#HybridPartI_topic8&quot;&gt;Additional Resources&lt;/a&gt; &lt;br /&gt;  &lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartI_topic1&quot;&gt;&lt;/a&gt;&lt;h3 class=&quot;subHeading&quot;&gt;Introduction&lt;/h3&gt;&lt;div class=&quot;subSection&quot;&gt; Business  and other organizations have written billions of lines of code in  Microsoft Visual Basic 6.0 since its introduction in 1998. Considering  how expensive and time-consuming it can be to upgrade important—even  mission-critical—Visual Basic 6.0 applications to Microsoft Visual Basic  2005, it is extremely common for organizations to continue maintaining  and even enhancing existing Visual Basic 6.0 applications.&lt;br /&gt; Many  developers and business have the impression that porting an application  to the Microsoft .NET Framework is a prerequisite to using the .NET  Framework for application enhancements. This is not the case. In fact,  you can extend existing Visual Basic 6.0 applications by building new  components in Visual Basic 2005. There is no need to port the entire  application to Visual Basic 2005.&lt;br /&gt; This series of articles covers  different ways to extend an existing Visual Basic 6.0 application—in  this case, a sample sales-force automation application—by using Visual  Basic 2005 and the .NET Framework.&lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartI_topic2&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;The Sales Support Application&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle1&quot;&gt;&lt;/a&gt; &quot;Sales  Support&quot; is a very simple sales-force support application that allows  the user to look up accounts, contacts, and forecasted sales. The  application is not intended to be a complete sales-force automation  solution. Instead, it is designed to be a representative placeholder for  an existing line-of-business Visual Basic 6.0 application. Also, it  serves as the anchor for a number of logical application enhancements  that are best implemented by using Visual Basic 2005.&lt;br /&gt;  &lt;h3 class=&quot;subHeading&quot;&gt;Installation&lt;/h3&gt;&lt;div class=&quot;subSection&quot;&gt; The Sales Support installer (&lt;a href=&quot;http://download.microsoft.com/download/A/5/6/A56DD645-14AF-4CC2-BEC6-EEBE5B284167/installer.03.zip&quot;&gt;http://download.microsoft.com/download/A/5/6/A56DD645-14AF-4CC2-BEC6-EEBE5B284167/installer.03.zip&lt;/a&gt;)  has been tested on Microsoft Windows XP SP2 and on Windows Vista, and  likely would work on older operating systems, too. Because this is a  hybrid Visual Basic 6.0 and Visual Basic 2005 application, the Sales  Support installer will install the.NET Framework 2.0 as a prerequisite.  This application also stores data in a back-end database. For this  reason, the installer will install Microsoft SQL Server 2005 Express  Edition, which replaces Microsoft SQL Server 2000 Desktop Engine (MSDE  2000).&lt;br /&gt; If you do not have these prerequisites installed, the  installer will download them for you automatically. If they are already  installed, the installer will detect their presence and skip to the  application installation.&lt;br /&gt; The installation of prerequisites is  something that Microsoft Visual Studio 2005 greatly simplifies. You can  just select application prerequisites, as shown in Figure 1.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC115854.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 1. Making application prerequisites with Visual Studio 2005&lt;/b&gt; &lt;br /&gt; When  you create an installer for a hybrid application, the best strategy is  to create a new Visual Studio 2005 Setup Project, which will install any  prerequisites, such as the .NET Framework, and any Visual Basic 2005  extensions for your application. This installer will launch the existing  installer for your Visual Basic 6.0 application, too, after the  prerequisites and Visual Basic 2005 extensions are in place.&lt;br /&gt; You  continue to build your Visual Basic 6.0 installer as you always have: by  using the Visual Studio 6.0 Package and Deployment wizard, or any of  the excellent third-party deployment products. The result for users is  that they need only launch a single installer to have your  application—and everything on which it depends—be installed.&lt;br /&gt; &lt;/div&gt;&lt;h3 class=&quot;subHeading&quot;&gt;Operation&lt;/h3&gt;&lt;div class=&quot;subSection&quot;&gt; After the application is installed, you can launch it from the &lt;b&gt;Start&lt;/b&gt; menu. Look for the Sales Support8_3 entry. The application will  initially prompt you to log on. To simplify use, the user name and  password fields default to working values, as shown in Figure 2. You can  just click the &lt;b&gt;Login&lt;/b&gt; button to continue.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC955.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 2. The Sales Support Login form&lt;/b&gt; &lt;br /&gt; After  you have logged on, the main application window appears, as shown in  Figure 3. The application provides three different views of the sales  information. The &lt;b&gt;Accounts&lt;/b&gt; tab provides the first view and shows  each account and associated sales information. This view can be sorted  differently by clicking on a column heading. The &lt;b&gt;Contacts&lt;/b&gt; tab provides the second view and shows more detailed information about each individual contact. The &lt;b&gt;Forecast&lt;/b&gt; tab provides the third view and displays future sales-forecast information.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC62619.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 3. The main application window&lt;/b&gt; &lt;br /&gt; Again,  the Sales Support application is not designed to be a working  sales-force solution. Instead, it serves only as a basis for realistic  application enhancements.&lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartI_topic3&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Windows Desktop Search Enhancement&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle2&quot;&gt;&lt;/a&gt; Sales-force  applications must track the flow of communications to the client. A  logical extension for the Sales Support application would be better  integration with e-mail. It would be especially useful to be able to  retrieve all of the communication to and from a particular contact, and  to do so from within the application itself.&lt;br /&gt; Microsoft provides  this base functionality through the free Microsoft Windows Desktop  Search (WDS). WDS typically runs as its own separate application;  however, for the best user experience, it would be better to surface the  WDS functionality directly as part of the Sales Support user interface.&lt;br /&gt; The  first extension to Sales Support does exactly that. It includes a new  form, implemented in Visual Basic 2005 that retrieves all e-mail  messages to and from a client by using WDS. The client database contains  a set of fictitious e-mail addresses. To use the WDS functionality,  it&#39;s recommended that you edit one of the clients to contain an e-mail  address with which you have communicated.&lt;br /&gt; To configure a real e-mail address:&lt;br /&gt; &lt;ol&gt;&lt;li&gt;          Run the Sales Support application.&lt;br /&gt; &lt;/li&gt;&lt;li&gt;          Click the &lt;b&gt;Contacts&lt;/b&gt; tab. You will see contacts listed, as shown in Figure 4.&lt;br /&gt; &lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC173267.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 4. The Contacts tab&lt;/b&gt; &lt;br /&gt; &lt;ol&gt;&lt;li&gt;          Double-click the name of a contact, to edit that contact.&lt;br /&gt; &lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC46632.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 5. Editing a contact&lt;/b&gt; &lt;br /&gt; &lt;ol&gt;&lt;li&gt;          Change the e-mail address of the contact to your e-mail  address, your boss&#39;s e-mail address, or some other e-mail address with  which you have communicated, and then click OK.&lt;br /&gt; &lt;/li&gt;&lt;/ol&gt;The search functionality is accessed through a new &lt;b&gt;Communications&lt;/b&gt; button on the &lt;b&gt;Contacts&lt;/b&gt; tab, as shown in Figure 6.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC171298.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 6. Windows Desktop Search enhancement&lt;/b&gt; &lt;br /&gt; When the &lt;b&gt;Communications&lt;/b&gt; button is clicked, the Visual Basic 6.0 application calls out to a form  that was built by using Visual Basic 2005. This form calls into WDS to  retrieve the e-mail communications with the selected contact, as shown  in Figure 7.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC15596.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 7. New Visual Basic .NET form with search results&lt;/b&gt; &lt;br /&gt; Because  Visual Basic 2005 was used for this enhancement, this form gets a  number of features for free. Firstly, the splitter bar between the grid  and text area just works and requires zero code, because Visual Basic  2005 includes a &lt;b&gt;SplitPanel&lt;/b&gt; control. Secondly, the form and its  controls resize intelligently, because .NET Framework controls support  docking: The controls just fill whatever space is available to them.&lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartI_topic4&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Application Architecture&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle3&quot;&gt;&lt;/a&gt; The  core of the application is a Visual Basic 6.0 application that  communicates with a SQL Server 2005 Express database. When you click the  &lt;b&gt;Communications&lt;/b&gt; button on the Contacts form, the e-mail address  of the contact is passed to the Visual Basic 2005 form. As soon as the  Visual Basic 2005 form has the e-mail address, it calls into Windows  Desktop Search to retrieve the list of communications, and then calls  into Microsoft Office Outlook to retrieve the e-mail contents.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC109318.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 8. Application data flow&lt;/b&gt; &lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartI_topic5&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Visual Basic 2005 Implementation&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle4&quot;&gt;&lt;/a&gt; You can create forms that are callable from Visual Basic 6.0 by installing Visual Studio 2005 and the &lt;a href=&quot;http://msdn2.microsoft.com/en-us/vbrun/aa701259.aspx&quot;&gt;Interop Forms Toolkit 2.0&lt;/a&gt;.  By using the Interop Forms Toolkit 2.0, you can create Visual Basic  2005 forms that appear to Visual Basic 6.0 as regular COM objects.&lt;br /&gt; The  first steps are to install the Interop Forms Toolkit 2.0, start Visual  Studio 2005, and create a new Visual Basic 6.0 InteropForm Library  project, as shown in Figure 9.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC59359.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 9. Creating an InteropForm Library project&lt;/b&gt; &lt;br /&gt; The  new project contains an InteropForm item. This item is a regular Visual  Basic 2005 form that contains additional information that indicates  that a COM wrapper should be generated, making it easy for Visual Basic  6.0 to call into this form. If you want your component to contain  multiple forms, you can just add additional InteropForm project items,  as shown in Figure 10.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC173921.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 10. Adding additional InteropForms to the project&lt;/b&gt; &lt;br /&gt; In the InteropForm, you can easily mark various properties and methods as being COM-callable. For properties, you just use the &lt;b&gt;InteropFormProperty&lt;/b&gt; attribute, as shown in Listing 1.&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-1&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_cd0684c7-3dc8-49b6-9386-17fe856ad683&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    &amp;lt;InteropFormProperty()&amp;gt; _&lt;br /&gt;    Public Property EmailAddress() As String&lt;br /&gt;        Get&lt;br /&gt;            Return m_emailAddress&lt;br /&gt;        End Get&lt;br /&gt;        Set(ByVal value As String)&lt;br /&gt;            If value &amp;lt;&amp;gt; m_emailAddress Then&lt;br /&gt;                m_emailAddress = value&lt;br /&gt;            End If&lt;br /&gt;        End Set&lt;br /&gt;    End Property&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;b&gt;Listing 1. Exposing Visual Basic 2005 form properties to Visual Basic 6.0&lt;/b&gt; &lt;br /&gt; This  property will allow the Visual Basic 6.0 application to specify the  e-mail address for which communications should be found. The actual  searching is performed by the &lt;b&gt;Search&lt;/b&gt; function that is shown in Listing 2.&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-2&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_4d3f3c50-8ced-453a-b76e-3c3494371e45&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    &amp;lt;InteropFormMethod()&amp;gt; _&lt;br /&gt;    Public Sub Search()&lt;br /&gt;        LabelSearching.Visible = True&lt;br /&gt;        Application.DoEvents()&lt;br /&gt;&lt;br /&gt;        Dim cn As New OleDbConnection( _&lt;br /&gt;            &quot;Provider=Search.CollatorDSO;&quot; &amp;amp; _&lt;br /&gt;            &quot;Extended Properties=&#39;Application=Windows&#39;;&quot;)&lt;br /&gt;        Try&lt;br /&gt;            cn.Open()&lt;br /&gt;        Catch&lt;br /&gt;            MessageBox.Show(&quot;Search functionality is dependent &quot; &amp;amp; _&lt;br /&gt;                &quot;on Windows Desktop Search 3.0 or later, &quot; &amp;amp; _&lt;br /&gt;                &quot;which is not installed.&quot;)&lt;br /&gt;            Me.Close()&lt;br /&gt;            Return&lt;br /&gt;        End Try&lt;br /&gt;&lt;br /&gt;        Dim da As New OleDbDataAdapter(&quot;Select System.Title, &quot; &amp;amp; _&lt;br /&gt;            &quot;System.ItemURL, &quot; &amp;amp; _&lt;br /&gt;            &quot;System.Message.SenderName, &quot; &amp;amp; _&lt;br /&gt;            &quot;System.Message.SenderAddress, &quot; &amp;amp; _&lt;br /&gt;            &quot;System.Message.ToAddress, &quot; &amp;amp; _&lt;br /&gt;            &quot;System.Message.DateSent  &quot; &amp;amp; _&lt;br /&gt;            &quot;from systemindex &quot; &amp;amp; _&lt;br /&gt;            &quot;where (System.Message.SenderAddress = &#39;&quot; &amp;amp; _&lt;br /&gt;                m_emailAddress &amp;amp; &quot;&#39; &quot; &amp;amp; _&lt;br /&gt;            &quot;or CONTAINS(System.Message.ToAddress, &#39;&quot; &amp;amp; _&lt;br /&gt;                m_emailAddress &amp;amp; &quot;&#39;)) &quot; &amp;amp; _&lt;br /&gt;            &quot;and CONTAINS(System.Message.MessageClass, &#39;MAPI&#39;)&quot; &amp;amp; _&lt;br /&gt;            &quot;order by System.Message.DateSent desc&quot;, cn)&lt;br /&gt;&lt;br /&gt;        Dim dt As New DataTable&lt;br /&gt;        da.Fill(dt)&lt;br /&gt;        dt.Columns.Add(&quot;To&quot;, GetType(String))&lt;br /&gt;        For Each dr As DataRow In dt.Rows&lt;br /&gt;            Dim toAddress As New StringBuilder&lt;br /&gt;            For Each address As String In dr(&quot;System.Message.ToAddress&quot;)&lt;br /&gt;                If toAddress.Length = 0 Then&lt;br /&gt;                    toAddress.Append(address)&lt;br /&gt;                Else&lt;br /&gt;                    toAddress.Append(&quot;, &quot;).Append(address)&lt;br /&gt;                End If&lt;br /&gt;            Next&lt;br /&gt;            dr(&quot;To&quot;) = toAddress.ToString()&lt;br /&gt;        Next&lt;br /&gt;&lt;br /&gt;        bs.DataSource = dt&lt;br /&gt;&lt;br /&gt;        WdsResultsDataGridView.AutoGenerateColumns = False&lt;br /&gt;        WdsResultsDataGridView.DataSource = bs&lt;br /&gt;        bs.ResetBindings(False)&lt;br /&gt;&lt;br /&gt;        LabelSearching.Visible = False&lt;br /&gt;&lt;br /&gt;        cn.Close()&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;b&gt;Listing 2. Visual Basic 2005 Search function&lt;/b&gt; &lt;br /&gt; You can see that this function is marked with the &lt;b&gt;InteropFormMethod&lt;/b&gt; attribute, which exposes the &lt;b&gt;Search&lt;/b&gt; function to Visual Basic 6.0 applications.&lt;br /&gt; WDS  exposes an OLE DB provider, which allows you to query WDS by using SQL  statements. Here, you can see that a select statement is retrieving the  sender name, &quot;to&quot; address, date sent, and other information. The results  are limited to e-mail messages to or from the contact, and are sorted  by date. The details of forming a WDS query can be a little complex, as  WDS supports many fields and search options. (For links to WDS queries,  see the &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc299499%28vs.80%29.aspx#HybridPartI_topic8&quot;&gt;Additional Resources&lt;/a&gt; section.)&lt;br /&gt; An  e-mail can be sent to multiple reciepients, so that additional code is  used to generate a derived column that contains a comma-separated list  of &quot;to&quot; addresses. Finally, a &lt;b&gt;DataGridView&lt;/b&gt; control is bound to the results.&lt;br /&gt; In  Figure 5, you can see that the form shows also a preview of the actual  message. This information is not available from WDS, which is just an  index into e-mail messages and files. Instead, the form must communicate  with Office Outlook to get the e-mail contents.&lt;br /&gt; Every time that the user clicks on a different e-mail message in the grid, an event fires on the underlying &lt;b&gt;BindingSource&lt;/b&gt; object. The &lt;b&gt;BindingSource&lt;/b&gt; object is responsible for keeping track of the current record (much as the &lt;b&gt;Recordset&lt;/b&gt; object in Visual Basic 6.0) and firing events whenever something changes. The &lt;b&gt;PositionChanged&lt;/b&gt; event of the binding source is a good place to retrieve the contents  for the currently selected e-mail item, as shown in Listing 3.&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-3&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_a5b87f4b-40cf-429e-8347-4321469042b0&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;    Private Sub bs_PositionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles bs.PositionChanged&lt;br /&gt;        If outlookNs IsNot Nothing Then&lt;br /&gt;            Dim dr As DataRow = bs.Item(bs.Position).row&lt;br /&gt;            Dim s As String = EIDFromEncodedStringWDS30(dr(&quot;system.itemurl&quot;))&lt;br /&gt;            Dim mailItem As Object = outlookNs.GetItemFromID(s, Nothing)&lt;br /&gt;&lt;br /&gt;            If mailItem IsNot Nothing Then&lt;br /&gt;                RichTextBox1.Text = mailItem.body&lt;br /&gt;            Else&lt;br /&gt;                RichTextBox1.Text = &quot;Unable to show preview.&quot;&lt;br /&gt;            End If&lt;br /&gt;&lt;br /&gt;        Else&lt;br /&gt;            RichTextBox1.Text = &quot;Outlook is not installed.  &quot; &amp;amp; _&lt;br /&gt;                &quot;Unable to show preview&quot;&lt;br /&gt;        End If&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;b&gt;Listing 3. Getting the message contents from Office Outlook&lt;/b&gt; &lt;br /&gt; Items  are retrieved from Office Outlook by using an item ID. WDS returns the  item ID as a portion of the ItemURL field. The application extracts the  ID from the ItemURL field, and then uses the Office Outlook object model  to request the item. As soon as the item is retrieved, its contents are  displayed in a rich-text box.&lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartI_topic6&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Visual Basic 6.0 Implementation&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle5&quot;&gt;&lt;/a&gt; As  you can see, creating the new form in Visual Basic 2005 is relatively  straightforward and simple. Calling the new form from Visual Basic 6.0  also is straightforward and simple. When you compile the Visual Basic  2005 code, Visual Studio automatically registers it as a COM object.  From Visual Basic 6.0, it just shows up in the &lt;b&gt;References&lt;/b&gt; dialog box, as shown in Figure 11.&lt;br /&gt; &lt;div&gt;&lt;img alt=&quot;&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC117014.gif&quot; /&gt;&lt;/div&gt;&lt;b&gt;Figure 11. Referencing the Visual Basic 2005 extension from Visual Basic 6.0&lt;/b&gt; &lt;br /&gt; As  soon as the project has been referenced, you can call into the Visual  Basic 2005 code as you would any other COM object. The code to display  the search form is shown in Listing 4.&lt;br /&gt;  &lt;div class=&quot;codeSnippetContainer&quot; id=&quot;code-snippet-4&quot;&gt;    &lt;div class=&quot;codeSnippetContainerTabs&quot;&gt;             &lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCodeContainer&quot;&gt;        &lt;div class=&quot;codeSnippetToolBar&quot;&gt;            &lt;div class=&quot;codeSnippetToolBarText&quot;&gt;                             &lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;codeSnippetContainerCode&quot; dir=&quot;ltr&quot; id=&quot;CodeSnippetContainerCode_37ac1567-13c0-4620-92a5-e4c68262c53c&quot;&gt;            &lt;div style=&quot;color: black;&quot;&gt;&lt;pre&gt;Private Sub cmdCommunications_Click()&lt;br /&gt;    Dim frmSearch As VBNET_Extensions_WdsForm&lt;br /&gt;    Set frmSearch = New VBNET_Extensions_WdsForm&lt;br /&gt;    frmSearch.Show&lt;br /&gt;    frmSearch.EmailAddress = rsContacts(&quot;Email&quot;)&lt;br /&gt;    DoEvents&lt;br /&gt;    frmSearch.Search&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;b&gt;Listing 4. Calling into the Visual Basic 2005 extension from Visual Basic 6.0&lt;/b&gt; &lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartI_topic7&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Conclusion&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle6&quot;&gt;&lt;/a&gt; In  this example, you can see that it is not complicated to create Visual  Basic 2005 extensions to existing Visual Basic 6.0 application; in fact,  in many cases, it might well be the best course of action for many  legacy applications. Extending existing applications by using Visual  Basic 2005 allows you to leverage your existing investment and ramp up  on Visual Basic 2005 as you go. It&#39;s a very low-risk approach (compared  with migrating the entire application to Visual Basic 2005) and can  allow you to make enhancements to your application very quickly.&lt;br /&gt; &lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;HybridPartI_topic8&quot;&gt;&lt;/a&gt;&lt;div&gt;&lt;h2 class=&quot;LW_CollapsibleArea_TitleDiv&quot;&gt;&lt;div&gt;&lt;a class=&quot;LW_CollapsibleArea_TitleAhref&quot; href=&quot;https://www.blogger.com/null&quot; role=&quot;heading&quot; title=&quot;&quot;&gt;&lt;span class=&quot;LW_CollapsibleArea_Title&quot;&gt;Additional Resources&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h2&gt;&lt;div class=&quot;sectionblock&quot;&gt;&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;sectionToggle7&quot;&gt;&lt;/a&gt; &lt;ul&gt;&lt;li&gt;          Visual Basic Developer Center&lt;br /&gt; &lt;a href=&quot;http://msdn2.microsoft.com/en-us/vbasic/aa701259.aspx&quot;&gt;Microsoft Interop Forms Toolkit 2.0&lt;/a&gt; &lt;br /&gt; &lt;/li&gt;&lt;li&gt;          MSDN Library&lt;br /&gt;          &quot;&lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/aa168022%28office.11%29.aspx&quot;&gt;Handy Tasks Using Microsoft Office Outlook 2003 and Visual Basic .NET&lt;/a&gt;&quot;&lt;br /&gt;          &quot;&lt;a href=&quot;http://msdn2.microsoft.com/en-us/library/bb231255.aspx&quot;&gt;Overview of the Search SQL Syntax&lt;/a&gt;&quot;&lt;br /&gt; &lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;subSection&quot;&gt;  &lt;h4 class=&quot;subHeading&quot;&gt;About the author&lt;/h4&gt;&lt;div class=&quot;subSection&quot;&gt; Scott  Swigart spends his time consulting, authoring, and speaking about  converging and emerging technologies. With development experience going  back over 15 years, and by staying in constant contact with future  software-development technologies, Scott is able to help organizations  get the most out of today&#39;s technology while they prepare to leverage  the technology of tomorrow. Scott is also the author of several .NET  books, a certified Microsoft trainer (MCT) and developer (MCSD), and a  Microsoft MVP. Feel free to contact the Scott at &lt;a alt=&quot;&quot; href=&quot;mailto:scott@swigartconsulting.com&quot; target=&quot;_blank&quot;&gt;scott@swigartconsulting.com&lt;/a&gt;, or check out his latest musings at &lt;a href=&quot;http://blog.swigartconsulting.com/&quot;&gt;blog.swigartconsulting.com&lt;/a&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;</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/1173309246115071736/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/enhancing-application-with-windows.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/1173309246115071736'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/1173309246115071736'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/enhancing-application-with-windows.html' title='Enhancing an Application with Windows Desktop Search and Office Outlook Integration'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4023715279049293750.post-7953774290657558745</id><published>2017-03-14T11:03:00.004-07:00</published><updated>2017-03-14T11:03:31.929-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VISUAL BASIC 6.0"/><title type='text'>Calling Web Services from Visual Basic 6, the Easy Way</title><content type='html'>&lt;h1 class=&quot;title&quot;&gt;&lt;/h1&gt;&lt;div class=&quot;lw_vs&quot;&gt;    &lt;div id=&quot;curversion&quot;&gt;      &lt;strong&gt;                Visual Studio 2005             &lt;/strong&gt;    &lt;/div&gt;&lt;/div&gt;&amp;nbsp; Scott Swigart&lt;br /&gt;Swigart Consulting LLC&lt;br /&gt;  April 2006&lt;br /&gt;  Applies to:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Visual Basic 6&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Visual Basic .NET&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Visual Basic 2005&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Visual Studio 2005&lt;br /&gt;  &lt;strong&gt;Summary:&lt;/strong&gt; This article shows you how to build an  application that downloads satellite photos of a given street address  from Visual Basic 6. (12 printed pages)&lt;br /&gt;  &lt;h4 class=&quot;dtH1&quot;&gt;Contents&lt;/h4&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa730836.aspx#callwebsrvv6_topic1&quot;&gt;Introduction&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa730836.aspx#callwebsrvv6_topic2&quot;&gt;The Application&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa730836.aspx#callwebsrvv6_topic3&quot;&gt;Decisions&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa730836.aspx#callwebsrvv6_topic4&quot;&gt;Where Art Thou?&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa730836.aspx#callwebsrvv6_topic5&quot;&gt;A View from Beyond&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa730836.aspx#callwebsrvv6_topic6&quot;&gt;Conclusion&lt;/a&gt;&lt;br /&gt;  Click &lt;a href=&quot;http://download.microsoft.com/download/e/0/8/e08d9c20-8867-4404-a56c-10b6c0c77c54/CallingWebServicesfromVisualBasic6.msi&quot;&gt;here&lt;/a&gt; to download the code sample for this article.&lt;br /&gt;  Download the sample&lt;br /&gt;CallingWebServicesfromVisualBasic6.msi&lt;br /&gt;MSDNSamples\vb6&lt;br /&gt;  &lt;h2 class=&quot;dtH1&quot;&gt;Introduction&lt;/h2&gt;Websites expose all sorts of useful information. Through &lt;a href=&quot;http://www.amazon.com/&quot;&gt;Amazon&lt;/a&gt;, you can look up book ranks and make purchases; through &lt;a href=&quot;http://www.google.com/&quot;&gt;Google&lt;/a&gt;, you can search the World Wide Web; with &lt;a href=&quot;http://www.mappoint.com/&quot;&gt;MapPoint&lt;/a&gt;, you can look up addresses and get directions; and through &lt;a href=&quot;http://www.ebay.com/&quot;&gt;EBay&lt;/a&gt;, you can buy or sell, well, just about &lt;a href=&quot;http://www.dotcomscotland.co.uk/weirdsites/ebay/eBay1.htm&quot;&gt;anything&lt;/a&gt;.&lt;br /&gt;  The problem with websites is that they don&#39;t expose information in a  way that&#39;s easy for an application to consume. For example, you might  want your customer service agents to have an application that lets them  locate the nearest store, so that they can provide directions for  customers who call in. Building an application that screen-scrapes  MapPoint or MapQuest (1) would be hard, and (2) could break at any  moment if those websites change in any way.&lt;br /&gt;  The answer is &lt;a href=&quot;http://en.wikipedia.org/wiki/Web_service&quot;&gt;Web services&lt;/a&gt;.  Web services typically let an application make requests over the Web,  and rather than getting the data back as an HTML document, the data is  returned as &lt;a href=&quot;http://en.wikipedia.org/wiki/Xml&quot;&gt;XML&lt;/a&gt;. This makes it very easy for the application to consume the information. Web services have emerged as &lt;em&gt;the way&lt;/em&gt; that applications communicate with each other. In some cases, legacy  back-end systems are wrapped with Web services in order to easily expose  their data and functionality to the rest of the company. In other  cases, Web-based providers (such as those listed above) add a Web  service to allow programmatic access to the data and functionality that  they currently provide to Web browsers.&lt;br /&gt;  &lt;h2 class=&quot;dtH1&quot;&gt;The Application&lt;/h2&gt;For this article, I wanted to build an application that would  download satellite photos of a given street address. I know that the  satellite photos are available through the &lt;a href=&quot;http://www.terraserver.com/&quot;&gt;TerraServer&lt;/a&gt; Web service. I also know that you can convert a street address to a latitude/longitude through the &lt;a href=&quot;https://msdn.microsoft.com/mappoint/&quot;&gt;MapPoint Web service&lt;/a&gt; and through Geocoder, so I know that all the building blocks are available.&lt;br /&gt;  First, I&#39;ll show you the completed application (see Figure&amp;nbsp;1), and  then we&#39;ll examine how this was accomplished from Visual Basic 6.&lt;br /&gt;  &lt;div class=&quot;fig&quot;&gt;&lt;img alt=&quot;Aa730836.callwebsrvv601(en-US,VS.80).gif&quot; id=&quot;callwebsrvv601&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC13852.gif&quot; title=&quot;Aa730836.callwebsrvv601(en-US,VS.80).gif&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 1. Satellite photo of an address from Visual Basic 6&lt;/strong&gt;&lt;/div&gt;&lt;a href=&quot;http://download.microsoft.com/download/8/0/a/80a8307c-ece6-4f4d-94c9-ceeaae586ca4/VisualBasic6WebServices.wmv&quot;&gt;View the video for this article&lt;/a&gt;.&lt;br /&gt;  &lt;h2 class=&quot;dtH1&quot;&gt;Decisions&lt;/h2&gt;There are two ways in which you can call a Web service from Visual Basic 6. You can use the &lt;a href=&quot;https://www.microsoft.com/downloads/details.aspx?FamilyId=4922060F-002A-4F5B-AF74-978F2CD6C798&amp;amp;displaylang=en&quot;&gt;Web Services Toolkit&lt;/a&gt;, but when you call a Web service that takes &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa140321.aspx&quot;&gt;complex data&lt;/a&gt;,  this leaves you dealing with a lot of raw XML. In addition, the  satellite image will be returned from TerraServer as a series of image  tiles that must be pieced together. This means that your application  would get XML documents with &lt;a href=&quot;http://en.wikipedia.org/wiki/Base64&quot;&gt;Base64&lt;/a&gt;-encoded  image tiles. The application would have to decode these and somehow  stitch them together to make the complete image. From Visual Basic 6,  this would not be fun.&lt;br /&gt;  With Visual Basic .NET, however, this is very simple. Visual Basic  .NET can get the image tile and convert it to a bitmap, with just one  line of code. It can also easily put the tiles together to make the  complete image. In fact, you will find that, in most cases, the best way  to call a Web service from Visual Basic 6 is to write a little bit of  Visual Basic .NET code to make the call, and return the results as  standard COM that Visual Basic 6 can consume.&lt;br /&gt;  &lt;h2 class=&quot;dtH1&quot;&gt;Where Art Thou?&lt;/h2&gt;The first step is to convert a street address into the latitude and  longitude coordinates needed by TerraServer. There are a couple ways to  go about this. The &quot;best&quot; way would be to use something like the &lt;a href=&quot;https://msdn.microsoft.com/mappoint/&quot;&gt;MapPoint Web service&lt;/a&gt;.  This is a highly reliable Web service provided by Microsoft that can  quickly convert the address to a latitude and longitude (a process known  as &quot;geocoding&quot;). MapPoint is designed to be high-performance, scalable,  and reliable enough that you can depend on it for mission-critical  applications. However, MapPoint has a couple of downsides that make it  less than ideal for casual use. First, you &lt;strong&gt;must&lt;/strong&gt; &lt;a href=&quot;https://mappoint-css.partners.extranet.microsoft.com/MwsSignup/Eval.aspx&quot;&gt;register&lt;/a&gt; and obtain an evaluation user ID and password. This authentication  information is used to make calls to the MapPoint service. This free  evaluation ID is valid for only 45 days. Also, after you register, it  can take a couple of days for you to receive your ID. I wanted to  provide you with a sample application that you could just download and  run, without any special registration or setup; therefore, in addition  to MapPoint, I included another option for geocoding the address.&lt;br /&gt;  The &lt;a href=&quot;http://www.geocoder.us/help/&quot;&gt;Geocoder.us&lt;/a&gt; website  also provides functionality for turning a street address into lat/long  coordinates. If you send the address as part of the query string, the  site will return an XML document containing the lat/long information. To  begin, I created a very simple class to hold the lat/long results (see  Listing&amp;nbsp;1).&lt;br /&gt;  &lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Listing 1. Class to hold lat/long information&lt;/strong&gt;&lt;/div&gt;&lt;pre class=&quot;code&quot;&gt;&amp;lt;ComClass(LatLongInfo.ClassId, LatLongInfo.InterfaceId, _&lt;br /&gt;LatLongInfo.EventsId)&amp;gt; _&lt;br /&gt;Public Class LatLongInfo&lt;br /&gt;&lt;br /&gt;#Region &quot;COM GUIDs&quot;&lt;br /&gt;    Public Const ClassId As String = &quot;4362FF28-FFF7-4BCE-B844-8CF4208536AC&quot;&lt;br /&gt;    Public Const InterfaceId As String = &quot;4A8FC896-6A9D-4F85-8B55-104CE4211829&quot;&lt;br /&gt;    Public Const EventsId As String = &quot;B9108846-8A2C-4698-831B-D3BC197168C5&quot;&lt;br /&gt;#End Region&lt;br /&gt;&lt;br /&gt;    Public Sub New()&lt;br /&gt;        MyBase.New()&lt;br /&gt;    End Sub&lt;br /&gt;&lt;br /&gt;    Private _lat As Double&lt;br /&gt;    Public Property Lat() As Double&lt;br /&gt;        Get&lt;br /&gt;            Return _lat&lt;br /&gt;        End Get&lt;br /&gt;        Set(ByVal Value As Double)&lt;br /&gt;            _lat = Value&lt;br /&gt;        End Set&lt;br /&gt;    End Property&lt;br /&gt;&lt;br /&gt;    Private _long As Double&lt;br /&gt;    Public Property [Long]() As Double&lt;br /&gt;        Get&lt;br /&gt;            Return _long&lt;br /&gt;        End Get&lt;br /&gt;        Set(ByVal Value As Double)&lt;br /&gt;            _long = Value&lt;br /&gt;        End Set&lt;br /&gt;    End Property&lt;br /&gt;End Class&lt;br /&gt;&lt;/pre&gt;This class just contains properties for the latitude and longitude.  In addition, the class contains attributes so that it will be exposed as  a COM object that can be used directly from Visual Basic 6.&lt;br /&gt;  The Geocoder site can then be used to look up an address and populate a &lt;strong&gt;LatLongInfo&lt;/strong&gt; object with the information (see Listing&amp;nbsp;2).&lt;br /&gt;  &lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Listing 2. Using Geocoder to get the lat/long for an address&lt;/strong&gt;&lt;/div&gt;&lt;pre class=&quot;code&quot;&gt;    Public Function AddressToLatLongGeocoder(ByVal address As String) _&lt;br /&gt;    As LatLongInfo&lt;br /&gt;        Dim wc As New WebClient&lt;br /&gt;        Dim geocodeStream As Stream = _&lt;br /&gt;            wc.OpenRead(&quot;http://geocoder.us/service/rest?address=&quot; _ &lt;br /&gt;            &amp;amp; address)&lt;br /&gt;&lt;br /&gt;        Dim xr As New XmlTextReader(geocodeStream)&lt;br /&gt;&lt;br /&gt;        Try&lt;br /&gt;            Dim ll As New LatLongInfo&lt;br /&gt;            While xr.Read()&lt;br /&gt;                If xr.Name = &quot;geo:lat&quot; Then&lt;br /&gt;                    ll.Lat = CDbl(xr.ReadInnerXml)&lt;br /&gt;                End If&lt;br /&gt;                If xr.Name = &quot;geo:long&quot; Then&lt;br /&gt;                    ll.Long = CDbl(xr.ReadInnerXml)&lt;br /&gt;                End If&lt;br /&gt;            End While&lt;br /&gt;&lt;br /&gt;            wc.Dispose()&lt;br /&gt;            Return ll&lt;br /&gt;        Catch&lt;br /&gt;            Return Nothing&lt;br /&gt;        End Try&lt;br /&gt;&lt;br /&gt;    End Function&lt;br /&gt;&lt;/pre&gt;The thing I love about .NET is that it makes interacting with the Web so easy. The &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/system.net.webclient.aspx&quot;&gt;WebClient&lt;/a&gt; class lets you &quot;open&quot; a URL as though it were a file. Since this &quot;file&quot; is an XML document, I can just use the &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/system.xml.xmltextreader.aspx&quot;&gt;XmlTextReader&lt;/a&gt; to look through the results for XML elements with certain names. When I find them, I just grab the values and put them into my &lt;strong&gt;LatLongInfo&lt;/strong&gt; class. If the website is unable to resolve the address, this function will return &lt;strong&gt;Nothing&lt;/strong&gt;; otherwise, it will return a &lt;strong&gt;LatLongInfo&lt;/strong&gt; class with the latitude and longitude of the street address.  &lt;br /&gt;  I also mentioned that you could use the MapPoint Web service to get  the lat/long for an address. The code for this is even simpler that  using Geocoder (see Listing&amp;nbsp;3).&lt;br /&gt;  &lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Listing 3. Geocoding an address using the MapPoint Web service&lt;/strong&gt;&lt;/div&gt;&lt;pre class=&quot;code&quot;&gt;    Public Function AddressToLatLongMapPoint(ByVal address As String, _&lt;br /&gt;        ByVal username As String, ByVal password As String) As LatLongInfo&lt;br /&gt;&lt;br /&gt;        Dim fs As New MapPoint.FindServiceSoap&lt;br /&gt;        fs.Credentials = New System.Net.NetworkCredential(username, password)&lt;br /&gt;        fs.PreAuthenticate = True&lt;br /&gt;&lt;br /&gt;        Dim addressInfo As New MapPoint.Address&lt;br /&gt;        addressInfo.FormattedAddress = address&lt;br /&gt;        Dim fas As New MapPoint.FindAddressSpecification&lt;br /&gt;        fas.InputAddress = addressInfo&lt;br /&gt;        fas.DataSourceName = &quot;MapPoint.NA&quot;&lt;br /&gt;&lt;br /&gt;        Dim results As MapPoint.FindResults = fs.FindAddress(fas)&lt;br /&gt;&lt;br /&gt;        Dim ll As New LatLongInfo&lt;br /&gt;        If results.Results.Length = 0 Then&lt;br /&gt;            Return Nothing&lt;br /&gt;        Else&lt;br /&gt;            With results.Results(0).FoundLocation.LatLong&lt;br /&gt;                ll.Lat = .Latitude&lt;br /&gt;                ll.Long = .Longitude&lt;br /&gt;            End With&lt;br /&gt;        End If&lt;br /&gt;        Return ll&lt;br /&gt;    End Function&lt;br /&gt;&lt;/pre&gt;The first few lines of this function just set up the user ID and  password so that they will be sent to the MapPoint Web service. To make  any calls to the MapPoint Web service, you must have already created an  account. If you don&#39;t have an account, and you want to use MapPoint  instead of Geocoder, you can register for an account &lt;a href=&quot;https://mappoint-css.partners.extranet.microsoft.com/MwsSignup/Eval.aspx&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;  The code then creates a MapPoint &lt;strong&gt;Address&lt;/strong&gt; object and populates it with the address supplied by the user. MapPoint has a number of &lt;a href=&quot;https://msdn.microsoft.com/library/default.asp?url=/library/en-us/mappointsdk/html/index.asp&quot;&gt;data sources&lt;/a&gt; (North America, Europe, and so on), and so the &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa493004.aspx&quot;&gt;FindAddressSpecification.DataSourceName&lt;/a&gt; is set to &lt;strong&gt;MapPoint.NA&lt;/strong&gt;, indicating that North America will be searched.&lt;br /&gt;  Finally, the call is made to &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa492579.aspx&quot;&gt;FindAddress&lt;/a&gt;. This returns a &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/aa502412.aspx&quot;&gt;FindResult&lt;/a&gt; object that contains the latitude and longitude information. This information is then just copied into my custom &lt;strong&gt;LatLongInfo&lt;/strong&gt; class and returned.&lt;br /&gt;  &lt;h2 class=&quot;dtH1&quot;&gt;A View from Beyond&lt;/h2&gt;Now that you know the latitude and longitude for the street address,  TerraServer can return a satellite image of that location. The image  comes in the form of image &quot;tiles&quot; that you must splice together to make  the complete image. The &lt;a href=&quot;http://terraserver.microsoft.com/about.aspx?n=AboutTerraServiceExampleMap&quot;&gt;code to do this&lt;/a&gt; is provided on the TerraServer website. I lifted this code and  converted it to Visual Basic .NET. The code begins by simply calculating  the pixel width and height of the desired image (see Listing&amp;nbsp;4).&lt;br /&gt;  &lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Listing 4. Calculating image dimensions in Visual Basic .NET&lt;/strong&gt;&lt;/div&gt;&lt;pre class=&quot;code&quot;&gt;    Public Function DownloadSatteliteImage(ByVal latLong As LatLongInfo, _&lt;br /&gt;        ByVal scale As Integer, _&lt;br /&gt;        ByVal widthTwips As Double, _&lt;br /&gt;        ByVal heightTwips As Double) As Object&lt;br /&gt;&lt;br /&gt;        Dim center As New LonLatPt&lt;br /&gt;        Dim theme As Integer&lt;br /&gt;        Dim mapWidth As Integer&lt;br /&gt;        Dim mapHeight As Integer&lt;br /&gt;&lt;br /&gt;        center.Lon = latLong.Long&lt;br /&gt;        center.Lat = latLong.Lat&lt;br /&gt;        theme = 1&lt;br /&gt;        mapWidth = Compatibility.VB6.TwipsToPixelsX(widthTwips)&lt;br /&gt;        mapHeight = Compatibility.VB6.TwipsToPixelsY(heightTwips)&lt;br /&gt;&lt;/pre&gt;Visual Basic .NET contains some helper functions that make it easy to  convert from Visual Basic 6 twips to standard pixels. This allows the  Visual Basic 6 application to pass in the height and width of the &lt;strong&gt;Image&lt;/strong&gt; control as twips, and the Visual Basic .NET code is able to calculate  the pixel dimensions so that it can call the TerraServer service and  correctly obtain the image.&lt;br /&gt;  Next, the code calls TerraServer with the image dimensions, and  TerraServer returns a list of tile IDs for the area that you want to  view (see Listing&amp;nbsp;5).&lt;br /&gt;  &lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Listing 5. Obtaining tile IDs for the area you want to view&lt;/strong&gt;&lt;/div&gt;&lt;pre class=&quot;code&quot;&gt;        Dim ts As New TerraService&lt;br /&gt;        Dim abb As AreaBoundingBox = ts.GetAreaFromPt(center, _&lt;br /&gt;            theme, scale, mapWidth, mapHeight)&lt;br /&gt;&lt;/pre&gt;The &lt;strong&gt;AreaBoundingBox&lt;/strong&gt; contains a list of all the image  tiles that will need to be downloaded in order to create the complete  image for the requested area. As each tile is downloaded, it will be  drawn into a .NET Framework &lt;strong&gt;Bitmap&lt;/strong&gt; object, which will eventually hold the completed image. The &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/system.drawing.bitmap.aspx&quot;&gt;Bitmap&lt;/a&gt; class makes it astonishingly easy to draw and work with graphics (see Listing&amp;nbsp;6).&lt;br /&gt;  &lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Listing 6. Creating a Bitmap object to hold the satellite photo&lt;/strong&gt;&lt;/div&gt;&lt;pre class=&quot;code&quot;&gt;        Dim pf As PixelFormat = PixelFormat.Format32bppRgb&lt;br /&gt;        Dim compositeImage As Bitmap = New Bitmap(mapWidth, mapHeight, pf)&lt;br /&gt;        Dim compositeGraphics As Graphics = Graphics.FromImage(compositeImage)&lt;br /&gt;&lt;/pre&gt;At this point, each tile can be downloaded and drawn to form the composite image (see Listing&amp;nbsp;7).&lt;br /&gt;  &lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Listing 7. Downloading each tile and adding it to the composite image&lt;/strong&gt;&lt;/div&gt;&lt;pre class=&quot;code&quot;&gt;        Dim xStart As Integer = abb.NorthWest.TileMeta.Id.X&lt;br /&gt;        Dim yStart As Integer = abb.NorthWest.TileMeta.Id.Y&lt;br /&gt;        For x As Integer = xStart To abb.NorthEast.TileMeta.Id.X&lt;br /&gt;            For y As Integer = yStart To abb.SouthWest.TileMeta.Id.Y Step -1&lt;br /&gt;                Dim tid As TileId = abb.NorthWest.TileMeta.Id&lt;br /&gt;                tid.X = x&lt;br /&gt;                tid.Y = y&lt;br /&gt;                Dim tileImage As Image = Image.FromStream( _&lt;br /&gt;                    New MemoryStream(ts.GetTile(tid)))&lt;br /&gt;                compositeGraphics.DrawImage(tileImage, _&lt;br /&gt;                    (x - xStart) * tileImage.Width - _&lt;br /&gt;                    CInt(abb.NorthWest.Offset.XOffset), _&lt;br /&gt;                    (yStart - y) * tileImage.Height - _&lt;br /&gt;                    CInt(abb.NorthWest.Offset.YOffset), _&lt;br /&gt;                    tileImage.Width, tileImage.Height)&lt;br /&gt;                tileImage.Dispose()&lt;br /&gt;            Next&lt;br /&gt;        Next&lt;br /&gt;&lt;/pre&gt;Here, each tile is downloaded and drawn on the composite image in the  correct location. When this loop is finished, the entire satellite  photo for the requested area will be downloaded, and the &lt;strong&gt;compositeImage&lt;/strong&gt; object will contain the complete image. The only thing left to do is  return this image so that it can be assigned to a Visual Basic 6 &lt;strong&gt;Image&lt;/strong&gt; or &lt;strong&gt;PictureBox&lt;/strong&gt; control.&lt;br /&gt;  I have to admit, the only part of this application that had me  worried was returning the image to Visual Basic 6. I knew that the .NET &lt;strong&gt;Bitmap&lt;/strong&gt; class, and the Visual Basic 6 &lt;strong&gt;Image&lt;/strong&gt; controls were not directly compatible, and I thought that converting the &lt;strong&gt;Bitmap&lt;/strong&gt; to something that Visual Basic 6 could use would be a pain. I spent  some time panning for answers in the stream of Google, looking for Win32  API calls or libraries that had already been written. But then, just to  make sure I wasn&#39;t overlooking something obvious, I looked through the &lt;a href=&quot;https://msdn.microsoft.com/en-us/library/cc437766.aspx&quot;&gt;Microsoft.VisualBasic.Compatibility.VB6&lt;/a&gt; object. This is the same object that provided the twips to pixels conversion. Sure enough, it had an &lt;strong&gt;ImageToIPictureDisp&lt;/strong&gt; method. The &lt;strong&gt;Picture&lt;/strong&gt; property of the &lt;strong&gt;Image&lt;/strong&gt; and &lt;strong&gt;PictureBox&lt;/strong&gt; controls is an &lt;strong&gt;IPictureDisp&lt;/strong&gt;, so this accomplished the conversion with one line of code (see Listing&amp;nbsp;8).&lt;br /&gt;  &lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Listing 8. Returning the completed image from Visual Basic .NET to Visual Basic 6&lt;/strong&gt;&lt;/div&gt;&lt;pre class=&quot;code&quot;&gt;        Return Compatibility.VB6.ImageToIPictureDisp(compositeImage)&lt;br /&gt;&lt;/pre&gt;From Visual Basic 6, you can call the &lt;strong&gt;DownloadSatelliteImage&lt;/strong&gt; method, pass in the lat/long and size of the image control, and get a satellite photo that just fits (see Listing&amp;nbsp;9).&lt;br /&gt;  &lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Listing 9. Calling DownloadSatelliteImage from Visual Basic 6&lt;/strong&gt;&lt;/div&gt;&lt;pre class=&quot;code&quot;&gt;    Dim msw As MapServiceWrapper.SatImageService&lt;br /&gt;    Set msw = New MapServiceWrapper.SatImageService&lt;br /&gt;    Dim satImage As Object&lt;br /&gt;    Set satImage = msw.DownloadSatteliteImage(latLong, hscrScale.Value, _&lt;br /&gt;        imgSatPhoto.Width, imgSatPhoto.Height)&lt;br /&gt;    Set imgSatPhoto.Picture = satImage&lt;br /&gt;&lt;/pre&gt;You can see that you just call &lt;strong&gt;DownloadSatelliteImage&lt;/strong&gt;,  passing in the lat/long, the scale (how zoomed-in you want the image to  be), and the height and width. The Visual Basic .NET code does the work  of calling TerraServer and composing the full image (see Figure&amp;nbsp;2). The  image is returned, and it can just be assigned to the &lt;strong&gt;Picture&lt;/strong&gt; property of the Visual Basic 6 &lt;strong&gt;Image&lt;/strong&gt; control.&lt;br /&gt;  &lt;div class=&quot;fig&quot;&gt;&lt;img alt=&quot;Aa730836.callwebsrvv602(en-US,VS.80).gif&quot; id=&quot;callwebsrvv602&quot; src=&quot;https://i-msdn.sec.s-msft.com/dynimg/IC80901.gif&quot; title=&quot;Aa730836.callwebsrvv602(en-US,VS.80).gif&quot; /&gt;&lt;/div&gt;&lt;div class=&quot;label&quot;&gt;&lt;strong&gt;Figure 2. Image downloaded and displayed in a Visual Basic 6 application&lt;/strong&gt;&lt;/div&gt;&lt;h2 class=&quot;dtH1&quot;&gt;Conclusion&lt;/h2&gt;Building this application with just Visual Basic 6 would have been  really hard. To download a Web page, I would have needed to use a Web  browser control, and then extract the document information. This is  overkill compared to the simple classes that the .NET Framework provides  for this task. The Web Services Toolkit would have been needed in order  to call the Web services, leaving me to deal with a lot of raw XML. I  don&#39;t know how I would have decoded the Base64-encoded image tiles or  stitched them together. &lt;br /&gt;  However, by extending Visual Basic 6 with Visual Basic .NET, this was  really easy to do. Hopefully, this article has illustrated how you  could take an existing Visual Basic 6 application, and then extend it  with Visual Basic .NET in order to pull real-time information from Web  services. The Web services might be hosted inside of your organization  to expose back-end systems, or they may exist on the Web—for example,  Google, eBay, Amazon, or MapPoint. There are Web services that expose  stock prices, weather information, and just about any other data. And,  with the combination of Visual Basic 6 and Visual Basic .NET, they are  all at your disposal.&lt;br /&gt;  &lt;br /&gt;  &lt;strong&gt;About the Author&lt;/strong&gt; Scott Swigart spends his time consulting, authoring, and speaking  about emerging and converging technologies. Scott has worked with a wide  range of technologies over his career, beginning with Commodore 64  programming at the age of 12, writing hardware diagnostics for UNIX  systems in C++, and building Windows desktop and Web applications. Over  the years, Scott has worked with component development, XML  technologies, .NET, Web services, and other languages, platforms, and  paradigms. With this experience, Scott has seen how technology evolves  over time, and he is focused on helping organizations get the most out  of the technology of today while preparing for the technology of  tomorrow. Scott is also a Microsoft MVP, and co-author of numerous books  and articles. Scott can be reached at &lt;a href=&quot;mailto:scott@swigartconsulting.com&quot;&gt;scott@swigartconsulting.com&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='https://pablobenidau.blogspot.com/feeds/7953774290657558745/comments/default' title='Posting Komentar'/><link rel='replies' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/calling-web-services-from-visual-basic.html#comment-form' title='0 Komentar'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/7953774290657558745'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/4023715279049293750/posts/default/7953774290657558745'/><link rel='alternate' type='text/html' href='https://pablobenidau.blogspot.com/2017/03/calling-web-services-from-visual-basic.html' title='Calling Web Services from Visual Basic 6, the Easy Way'/><author><name>Pablo Benidau</name><uri>http://www.blogger.com/profile/10996407910241657616</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//2.bp.blogspot.com/-UE0WHp06Pfg/WK3gtrX0SzI/AAAAAAAABnQ/J1YID7_x77IKGkzyx3bzwmj1T4XxqUyIgCK4B/s220/c.jpg'/></author><thr:total>0</thr:total></entry></feed>