BLOG

 

Release 0.98 has been just released

clock April 25, 2008 08:16

Yesterday we worked hard to fix a subtle bug related to project groups, plus other minor stuff related to the Data and TabStrip controls.

Today is a nationa holiday here in Italy, but our beta testers abroad can download version 0.98 and play with it during the weekend. (We know for sure that some do! )

 

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Version 0.97 is online!

clock April 21, 2008 05:09

This is truly a milestone in our release story. We have added many new features, including support for Visual Studio 2008 and for batch migratons. A number of KB articles describe how to use these new features, for example

[HOWTO] Generate Visual Studio 2008 project

We have added many new pragmas:

PreInclude and PostInclude pragmas allow you to include a piece of VB6 code (before the parsing step) or a piece of VB.NET code (after the migration is completed); they even support recursive inclusion (an include file can contain other PreInclude and PostInclude pragmas). The PreInclude pragma can be used in a *.pragmas file and in practice allows you to have all these *.pragmas file reference the same settings stored in a centralized file.

The OutputMode pragma now supports an Uncomment mode, which allows you to includ a block of remarked out VB.NET code and have it un-remarked during the migration process. (It is a great way to include large pieces of VB.NET code in the middle of a VB6 source file.) You can find an usage example here:

[HOWTO] Exclude portions of VB6 code from the migration process and replace it with custom VB.NET statements

We changed the way we deal with Empty and Null values. In previous releases, these values were migrated to VB6Empty and VB6Null constants, and both of them were set equal to Nothing. Using constants was necessary to support Null and Empty values when they appear as default values for optional parameters, as in this statement

    Sub Test(Optional x As Variant = Null)

However, using constants didn't make it possible to map the null value to DBNull.Value, and a few beta testers complained about this. Thus we decided to map these values to Empty6 and Null6 properties, which by default are equal to Nothing and DBNull.Value, respectively, but can be changed if necessary. You can find more details in this article:

[HOWTO] Deal with Null and Empty values

Another minor improvement on previous releases: we have added the VB6Config class that gathers all the settings that you can change at runtime to fine tune the library's behavior, as explained here:

[HOWTO] Determine whether unsupported member throw an exception at runtime

[HOWTO] Ignore fatal error at runtime

The new VB6Config.FocusEventSupport lets you work around a key difference in how VB6 and VB.NET deal with LostFocus and Validate events:

[INFO] Controlling the LostFocus and Validate event sequence

We are including a new extender that allows you to create a text file containing the list of all the migration issues and warnings. It's a precious feature when you migrate multiple projects in batch mode. You can read more details in this article:

[HOWTO] Create a report with all the migration issues and warnings

We also added a few KB articles that illustrate non-obvious way to use PostProcess pragmas, for example:

[HOWTO] Modify project-level options in VB.NET programs

[HOWTO] Enforce project-level Option Strict Off settings in VB.NET programs

Last but not the least, we have fixed 35 bugs. As usual, beta tester can find the complete list in the VERSION HISTORY.TXT file.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


New great features are on the way...

clock April 15, 2008 19:49

While we are still busy on release 0.97, I want to let you know in advance what we working on.

First and foremost, VB Migration Partner now supports both Visual Studio 2005 and Visual Studio 2008. You have to change a line in the beta's configuration file to enable VB2008 support, but it won't be necessary with the "real" product, because we plan to deliver two distinct versions of release 1.0, each one generating different flavors of Visual Basic projects.

Another great new feature is the support for batch migrations: you can run VB Migration Partner via a command-line tool and integrate it in your build process. If your application consists of dozens of separate projects, this feature can save you a lot of time and efforts. Even if you don't use a build process, you can automate the re-migration of the entire application by means of a plain batch file. 

We have added a tab to the Tools-Options dialog box, where you can select a default output folder for converted projects. Not really an amazing feature, yet something that is quite handy when converting a multiple-project application.

Another simple but useful feature: project GUIDs are preserved when re-migrating a project that had been migrated previously. If you wonder why this can be useful, just imagine the following scenario. You migrate projects P1 and P2 to VB.NET (separatedly), then you launch Visual Studio 2005/2008 and create a solution S1 that gathers the two project. (Creating a single solution can be useful for debugging purposes, for example.) If you find a bug in P1 you can now re-migrate it without breaking the S1 solution, because the link between a solution and its projects depends on the project's GUID stored in the *.vbproj file. Ditto for references between projects in the same solution. It's a tiny feature but a great time saver.

Finally, we have changed the Excel template used to generate assessment estimation of time/cost of the migration process. You can now use your own formulas to define how the cost grows when the number of occurrences of a given issue grows. Thanks to this new feature you can create more reasonable migration plans.

Version 0.97 is arriving in a few days. Beta testers, stay tuned! .... and thanks for your precious support in these months. 

 

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Version 0.96 available to beta testers

clock March 22, 2008 02:21

 

We have just uploaded version 0.96. There are very few new features, namely

  • the SendToBack pragma allows you to finely control the z-ordering of controls
  • he MoveControlOverButton special method of the Toolbar control makes it easy to remedy to the fact that the .NET toolbar can't work as a control container (unlike the VB6 toolbar)
  • VB Migration Partner now correctly migrates the Command Line string that you set in the Make tab of the Project Properties dialog box

Of course we've also fixed several bugs, most of which related to the MaskEdBox control and the DAO/RDO data controls. More details are available in the Version History.txt file.

We are quickly approaching version 1.0, which we plan to release in mid-April. The beta test program officially ended some weeks ago, we apologize that we had to reject all subsequent requests.

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Play battleship with VB Migration Partner!

clock March 11, 2008 23:07

We found a very nice VB6 sample, that allows two opponents to play battleship from two different computers, even across the Internet. The program consists of a server portion and a client portion, and the two use the Winsock control to communicate. The VB6 code uses also a lot of graphic statements to implement a nice user interface.

Thanks to VB Migration Partner, it took us only a few minutes and some pragmas to convert this game to VB.NET.

You can find the result in our Code Sample section. Enjoy! 

 

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


One step closer to release 1.0 !

clock March 6, 2008 00:31

Last night we released version 0.95. It doesn't add any new feature, yet it is an important milestones because this version has reached the zero-known-bug stage for the parser & code generation engine. We are quickly fixing all the known problems in the support library and are getting closer to the official 1.0 release.Smile

 


 

The new parser & code generator is truly as sophisticated as it can possibly be. Here's a little example of what version 0.95 is able to do.

Consider the following statements:

    Dim tw As New TextboxWrapper
    ....
    tw.FieldBox = Form1.Text1      ' where FieldBox is defined in TextboxWrapper.cls as a property that takes and returns a TextBox control

According to standard VB6 rules, the lack of the SET keyword should imply that you are assigning the default Text property of Form1.Text1 to the default Text property of the control referenced by the FieldBox property. As a matter of fact, the Upgrade Wizard that comes with Visual Studio (as well as previous versions of VB Migration Partner) translate the above assignment as follows:

    tw.FieldBox.Text = Form1.Text1.Text

However, one of our beta testers discovered the following undocumented VB6 behavior: if the FieldBox is (mistakenly) defined by means of a Property Let procedure (instead of Property Set), then VB6 performs an object reference assignment even if the SET keyword has been omitted. Never head of it previously! However, we want to promote VB Migration Partner as a "It just works!" code migrator, therefore we decided to emit VB.NET code that perfectly mimics the original VB6 behavior:

    tw.FieldBox = Form1.Text1    ' in VB.NET this is an object assignment

I am not mentioning this feature because I think it will be of interested to many VB Migration Partner users, but only to emphasize that our code translator is easily the most sophisticated you can find anywhere...

Together with version 0.95 we are releasing a new code sample, named Cool ProgressBar. It's a custom control written in VB6 which, as its name implies, implements a better, eye-catching progress bar, with gradient colors and other intriguing features. It's a nontrivial piece of code that uses a lot of Windows API and GDI programming, yet it took us just a few minutes (and 4 pragmas) to migrate it correctly to VB.NET. Even if you don't care about VB Migration Partner, you can download the code sample to see how those features were implemented and - if you wish - use this new control in your .NET apps.

 

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Three more code samples

clock February 28, 2008 03:46

We just posted three new apps in our Code Samples section:

A complete Web Browser is what its name implies. This sample uses the WebBrowser control to implement a full-featured web browser, which supports URL auto-completion, printing, HTML source window, favorite window, and progress bar. VB Migration Partner can migrate it without adding any pragma!

ezDatabase is a demostration of virtually all ADODB features. VB Migration Partner convert this sample correctly at the first attempt, therefore it is also a great demo of VBMP's converting features. Unfortunately, the original VB6 code has a few bugs and they are migrated as well. (In other words, if you see any malfunctioning in VB.NET code, check the original VB6 code before putting the blame on VB Migration Partner )Wink

LCD Clock is a simple digital clock with many options. You can move on top of other window and move with the mouse. It has other intriguing features, all of which are correctly migrated to VB.NET. We needed just one WriteProperty pragma to beautify the user interface.

Note for Beta testers: current version 0.94 can't correctly migrate the WebBrowser sample, due to a number of bugs for the WebBrowser control that we've fixed after the 0.94 release. The support library that comes with these samples doesn't suffer from these bugs.

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Version 0.94 is out!

clock February 25, 2008 22:15

Another little step towards the official 1.0 release...

 Version 0.94 adds many important features, including:

  • the ability to clear the typelib cache when the program starts (in Options-General)
    The typelib cache is an area of your hard disk where VB Migration Partner stores the .NET assemblies resulting from the conversion of COM type libraries, and is useful to speed up execution. We now provide the option to clear this cache when the program starts because it might solve a few issues that might occur when your VB6 app references a .NET DLL via interop and you've recompiled the .NET DLL. Also, disabling this option allows to run multiple instances of VB Migration Partner (which might raise problems if automatic typelib cache clearing is enabled)
  • a new setting to decide how many migration errors and warnigns are displayed in the bottom pane and the initial status of Errors/Warnings/Infos/ToDos switches (in Options-Results)
    Many beta testers asked for this feature, which is essential when migrating very large applications. When you have thousands of messages in the bottom pane, switching between windows is painfully slow. This new option greatly reduces this problem. (Incidentally, this is the very reasons why Visual Studio has an upper limit to the number of compiler messages that can be displayed in its Error List pane.)
  • A new command allows you to quickly edit the master VBMigrationPartner.pragmas file, located in VB Migration Partner's install folder. By putting pragmas in this file you can control the default behavior used when migrating several VB6 statements, for example how arrays with nonzero LBound are migrated, or whether the support for default members is enabled by default. Of course you can always override such settings with pragmas inside individual projects.
     
  • The AxWrapperGen utility has been greatly improved, which means that it is now easier to create wrappers for 3rd party ActiveX controls.
  • A warning is emitted if the VB6 project contains a pragma that should be located in a *.pragmas file, for example an AddLibraryPath or ProProcess pragma.

We also fixed nearly 50 bugs, so the program is better and more stable than before. As usually, you can learn more by browsing the VERSION HISTORY.TXT file, in VB Migration Partner's install folder.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Comparing the & operator, the String.Concat method and the String.Format method

clock February 20, 2008 06:16

You might be aware that VB.NET supports at least 4 techniques to append strings:

    1) the & operator (or the + operator)

    2) the String.Concat static method

    3) the String.Format static method

    4) the StringBuilder object and its Append and Insert methods

By peeking at the code that the VB.NET compiler generates for the & (or +) operator, you can quickly realize that this operator is rendered as a call to the String.Concat method, thus using either technique #1 or #2 has no impact on performance and is just a matter of coding style. I usually prefer the & operator over String.Concat for readibility's sake, and I guess most VBers do the same, but it should be clear that the two are perfectly equivalent if you are concerned only about speed. (NOTE: when working with values other than strings, you might find String.Concat more readable, because it doesn't force you to explicitly invoke the ToString() method of each operand.)

When working with long strings that undergo many concatenations, the StringBuilder object is the fastest technique, period. Too much digital ink has been spilled on this topic, and I won't repeat those well-known concepts here. (BTW, if you're looking for a smart way to replace the & operator with the StringBuilder object without messing up your existing code, read here.)

However, when you have to perform a few concatenations on many short strings, the overhead needed to setup the StringBuilder object often shadows the benefits of its Append method. In these scenarios, the choice is among techniques #1 (or #2, which is equivalent) and technique #3. Today I decided to take some time to compare their performance. I run 100,000 concatenations over two or more 10-char strings. Here are the results on my on a 2.20 GHz Core Duo, 2G RAM Dell notebook running Vista (timings are in milliseconds and are averaged over several runs):

# of operands   Concat    Format
2                  12         60
3                  22         95
4                  28        150
5                 125        160
6                 185        192
7                 210        215
8                 235        239
9                 270        272

To summarise, the Concat method runs 4-5 times faster than Format with 4 operands of fewer, but there is no significant difference with 6 or more operands. It is interesting to notice the steep increase (from 28 to 125 milliseconds) for the Concat method when passing fro 4 to 5 arguments. The reason: there is no String.Concat overload that takes 4 arguments, therefore the VB.NET (and C#) compiler has to build a temporary array with 5 elements and pass it to the String.Concat overload that takes a ParamArray. The same thing happens with the String.Format method when you pass from 3 to 4 arguments.

In general, I prefer to use the String.Format method when appending 3 or more strings, except inside time-critical code. For example, I use it for building error messages and other UI elements; in this case the loss of speed rarely (or never) affects the overall execution speed. Another advantage of String.Format is that you can easily create a table of messages and store them on a database, an XML file, or just a plain text file (possibly stored as a resource). For example, all VB Migration Partner error and warning messages are stored in a format like this:

        Using the '{0}' Windows API method as an argument to the '{1}' function might result in an string filled with spaces. Please split the next line in two statements.

This approach makes the code more readable and maintenable. Plus, localizing the code for a language other than English will be a breeze, if I ever need to.

---------------------------------------

Speaking ofconcatenations, the fact that Concat, Format and other static methods of the System.String class have an overload that takes a ParamArray (and therefore a standard array) makes it possible to implement a few nice tricks. For example, you can quickly concatenate all the elements in an array using this code:

    Dim arr() As String = {"one", "two", "three", "four"}
    Dim res As String = String.Concat(arr)    ' => onetwothreefour

If you need to use a delimiter between each element or concatenate onlya subset of the array, use the String.Join method:

    res = String.Join(" ", arr)         ' => one two three four
    res = String.Join(" ", arr, 1, 2)   ' => two three

When working with arrays of 10 elements or fewer, or you are interested in just the first 10 elements, you can use the Format method in creative ways, as in this code:

    ' display elements in random order
    res = String.Format("{3} {1} {0} {2}", arr)    ' => four two one three 

 

Currently rated 4.0 by 2 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


Four new (amazing!) code samples

clock January 23, 2008 06:06

We have made four new migrated programs available in our Code Sample section. All of them are quite interesting - because they show VB Migration Partner's muscles, but also because they are intriguing in themselves.

EGL25 is an amazing ray tracer written in VB6, which is so fast that you can interactively rotate complex objects made of thousands polygons in real time. What is even more amazing is that VB Migration Partner managed to convert it to VB.NET at the first attempt!

Spell Checker is what its name implies: it comes with a dictionary of over 450,000 English words and uses a sophisticated Soundex-like algorithm to suggest words that are "similar" to the one you entered. Also in this case we managed to convert this code at the first attempt.

ID Card Maker allows you to create your own ID card. Very simple, but it is a good demonstration of VB Migration Partner's graphic capabilities. 

Type-n-Sign teaches you the sign language and shows how well VB Migration Partner deals with API Declares, non-rectangular forms, and other advanced programming techniques.

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5


VB Migration Partner - Subscribe to our feed RSS  blog RSS
 
AddThis Feed Button
 
 

Home blog
 
AddThis Social Bookmark Button


 

Sign in

Search

Calendar

<<  May 2008  >>
SuMoTuWeThFrSa
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

Archive

Categories

 

Microsoft Regional Director
Microsoft is a registered trademark of Microsoft Corporation in the United States and other countries and is used under license from Microsoft
 

My Blogs


My programming tools



VB Migration Partner


VBMaximizer for VB6


Form Maximizer for .NET

 

My books


Programming Microsoft Visual Basic 6


Programming Microsoft Visual Basic 2005: The Language


Practical Guidelines and Best Practices for Microsoft Visual Basic .NET and Visual C# Developers



Programming Microsoft Visual C# 2005: The Base Class Library


Programming Microsoft Visual Basic .NET


Programming Microsoft Visual Basic .NET 2003


Applied Microsoft .NET Framework Programming with Microsoft Visual Basic .NET