<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>New PAG book &amp; tool to help learn VB6 to VB.NET migration approaches (by PaulYuk)</title><link>http://blogs.msdn.com/b/vbteam/archive/2005/11/16/new-pag-book-tool-to-help-learn-vb6-to-vb-net-migration-approaches-by-paulyuk.aspx</link><description>Jackie GoldStein , our partner and friend, just created a great post talking about the new resources created by the MS Patterns and Practices Team. 
 
 I think these are must have assets for any team thinking about an upgrade. Here are a few more notes</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: New PAG book &amp; tool to help learn VB6 to VB.NET migration approaches (by PaulYuk)</title><link>http://blogs.msdn.com/b/vbteam/archive/2005/11/16/new-pag-book-tool-to-help-learn-vb6-to-vb-net-migration-approaches-by-paulyuk.aspx#493873</link><pubDate>Thu, 17 Nov 2005 16:57:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:493873</guid><dc:creator>Robert Conley</dc:creator><description>Great guide if you are converting a database front end. But any other type of vb application it is useless particulary graphics intensive programs like CAD/CAM software.&lt;br&gt;&lt;br&gt;What is needed are compatibility object that mimic VB6 objects. Plus GDI+ needs to be a lot quicker than it is now.&lt;br&gt;VB6&lt;br&gt;    Dim I As Double&lt;br&gt;    Const H As Double = 500&lt;br&gt;    Const W As Double = 500&lt;br&gt;    '   ' Init&lt;br&gt;    Me.ForeColor = vbBlack&lt;br&gt;    Me.DrawWidth = 1&lt;br&gt;    &lt;br&gt;    '&lt;br&gt;    For I = 0 To W Step 5&lt;br&gt;        Call Me.Line(I, 0)-(I, H)&lt;br&gt;    Next&lt;br&gt;    '&lt;br&gt;    For I = 0 To H Step 5&lt;br&gt;        Call C.DrawLine(0, I)-( W, I)&lt;br&gt;    Next&lt;br&gt;&lt;br&gt;GDI+&lt;br&gt;&lt;br&gt;   Dim I As Int32&lt;br&gt;   Dim G As Graphics&lt;br&gt;   P As Pen&lt;br&gt;   Const H As Int32 = 500&lt;br&gt;   Const W As Int32 = 500&lt;br&gt;   &lt;br&gt;   ' Init&lt;br&gt;    G = Me.CreateGraphics&lt;br&gt;    P = New Pen(Color.Black)&lt;br&gt;  &lt;br&gt;    For I = 0 To W Step 5&lt;br&gt;        G.DrawLine(P, I, 0, I, H)&lt;br&gt;    Next&lt;br&gt;   &lt;br&gt;    For I = 0 To H Step 5&lt;br&gt;        G.DrawLine(P, 0, I, W, I)&lt;br&gt;    Next&lt;br&gt;&lt;br&gt;   ' Cleanup&lt;br&gt;    Set P = Nothing&lt;br&gt;    Set G = Nothing&lt;br&gt;&lt;br&gt;VB6 Flat GDI+ Api&lt;br&gt;&lt;br&gt;   Dim Graphics As Long, Pen As Long&lt;br&gt;   Dim I As Long&lt;br&gt;   Const H As Long = 500&lt;br&gt;   Const W As Long = 500&lt;br&gt;   &lt;br&gt;   ' Init&lt;br&gt;   Call GdipCreateFromHDC(Me.hDC, Graphics)&lt;br&gt;   Call GdipCreatePen1(Black, 1, UnitPixel, Pen)&lt;br&gt;&lt;br&gt;   For I = 0 To W Step 5&lt;br&gt;      Call GdipDrawLineI(Graphics, Pen, I, 0, I, H)&lt;br&gt;   Next&lt;br&gt;   &lt;br&gt;   For I = 0 To H Step 5&lt;br&gt;      Call GdipDrawLineI(Graphics, Pen, 0, I, W, I)&lt;br&gt;   Next&lt;br&gt;   &lt;br&gt;   &lt;br&gt;   ' Cleanup&lt;br&gt;   Call GdipDeletePen(Pen)&lt;br&gt;   Call GdipDeleteGraphics(Graphics)&lt;br&gt;&lt;br&gt;VB6 GDI&lt;br&gt;&lt;br&gt;    Dim hDC As Long&lt;br&gt;    Dim I As Long&lt;br&gt;    Dim pt As POINTAPI&lt;br&gt;    Const H As Long = 500&lt;br&gt;    Const W As Long = 500&lt;br&gt;    &lt;br&gt;    hDC = GetDC(Me.hwnd)&lt;br&gt;    For I = 0 To W Step 5&lt;br&gt;        Call MoveToEx(hDC, I, 0, pt)&lt;br&gt;        Call LineTo(hDC, I, H)&lt;br&gt;    Next&lt;br&gt;    '&lt;br&gt;    For I = 0 To H Step 5&lt;br&gt;        Call MoveToEx(hDC, 0, I, pt)&lt;br&gt;        Call LineTo(hDC, W, I)&lt;br&gt;    Next&lt;br&gt;    &lt;br&gt;    Call ReleaseDC(hwnd, hDC)&lt;br&gt;&lt;br&gt;&lt;br&gt;The VB6 native graphics and GDI run about 20 times faster (a 100 loops averaging 40 milliseconds on my machine)&lt;br&gt;&lt;br&gt;The VB6 flat GDI+ Api and VB.NET 8 (2005) both in a 100 loops ran about 800 milliseconds on average. I tested on several other machine as well.&lt;br&gt;&lt;br&gt;This and nearly two dozen other issues is why so many of us VB6 developers are not migrating to VB.NET.&lt;br&gt;&lt;br&gt;Nearly all the migration examples I have seen offered are squared toward big corporate needs of web sites and database front end. Those of us who are consultants, VARs, and independent software developers has have their upgrade path throughly trashed by Microsoft decisions regarding VB.NET.&lt;br&gt;&lt;br&gt;The justifications for these decisions are increasing losing their value as technologies such as LINQ are being demonstrated. &lt;br&gt;&lt;br&gt;If you can add LINQ syntax to the Visual Basic langauge there is no reason you can't support the VB6 syntax. &lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Rob Conley&lt;br&gt;Head Programmer&lt;br&gt;Plasma Automation&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=493873" width="1" height="1"&gt;</description></item></channel></rss>