MZ-Tools 8.0.0.168 released introducing collector of ‘ TODO: tasks in code

Today MZ-Tools 8.0.0.168 has been released. It fixes an important performance bug that can happen using the Select Case Assistant for VBA/VB6/VB5 and other minor bugs but, more importantly, it introduces a quite requested feature: a collector of TODO tasks in code for those IDEs. MZ-Tools 8.0 already provided a Task List, but it was for tasks entered by hand, now called “general” tasks:These tasks are entered manually through a dialog and are not tied to code:

This new build provides a new tab in the Task List for “code” tasks, that are comments in code that start with ‘ TODO: or ‘TODO: (without space):

This features scans all the code of your project showing those types of comments. Hopefully you find this feature useful.

The complete changelog is the following:

  • Enhanced [#12326] (VB/VBA): The Task List provides now a new tab page to show code tasks (‘ TODO: comments) apart from general tasks.
  • Enhanced [#12287] (All): The commands GenerateXmlDocumentation and GenerateHtmlDocumentation can be now automated.
  • Fixed [#12312] (VS): NullReferenceException loading MZ-Tools on Visual Studio 2010, 2008 or 2005. This bug was introduced in last build 8.0.0.164
  • Fixed [#12307] (VS): The Add Line Numbers feature numbered lines after initializer ‘=’ in VB.NET 10.0 or higher.
  • Fixed [#12234] (VB/VBA): The Code Explorer could still cause System.NullReferenceException when closing.
  • Fixed [#12247] (VB/VBA): The Select Case Assistant didn’t parse correctly enum items with comments or conditional compilation directives.
  • Fixed [#12247] (VB/VBA): The Select Case Assistant could be very slow in some scenarios.
  • Fixed [#12347] (VBA): Using MSForms, pages of a MultiPage control were not retrieved on Windows 7.
  • Fixed [Internal] (All): The window to select a code template didn’t have the correct tab order.

MZ-Tools 8.0.0.164 released with enhancements and fixes

The new build 8.0.0.164 of MZ-Tools released yesterday fixes four minor bugs, but it introduces three handy enhancements.

The first one is for users of any IDE (Visual Studio, VBA, VB6 or VB5). The Select Case assistant (VB) or Switch Assistant (C#) for enums allows now you to specify an optional custom template for the enum items after the Case statement. This template can use the name of the enum item (in different forms, such as normal, uppercase, or uppercase with underscores) and the name of the parent enum. This is handy when the case statements perform assignments to constants, etc. The assistant shows now also a preview:

The second one is for VBA users: this build introduces also support for Most Used Properties in the Control Explorer, Form Default Properties and Control Default Properties (previously features that deal with properties of controls were only available for Visual Studio, VB6 and VB5):

Finally, for Visual Studio users, the number of commands for code templates has been increased from 9 to 50.

The complete changelog is the following:

  • Enhanced [#12247] (All): Added support for enum item template in Switch / Select Case Assistant for Enums.
  • Enhanced [#12204] (VBA): Added support for Most Used Properties (Control Explorer), Form Default Properties and Control Default Properties.
  • Enhanced [#12250] (VS): Increased the number of commands for code templates from 9 to 50.
  • Fixed [#12224] (VBA): The Task List could cause System.ArgumentException: (“Invalid characters in path”) saving tasks.
  • Fixed [#12234] (VB/VBA): The Code Explorer could cause System.NullReferenceException when closing.
  • Fixed [#12252] (VS): Expression-bodied function members caused NullReferenceException in C# 6.0 or higher.
  • Fixed [Internal] (VS): Controls of tab pages of programming and nomenclature rules review were not themed with the Dark theme.

MZ-Tools 8.0.0.162 released with several enhancements and bug fixes

Yesterday a new build 8.0.0.162 of MZ-Tools was released, adding some small enhancements and documenting a subject that can be interesting for some people: how to automate MZ-Tools to add / remove line numbers to a project from a build script. It also fixes some small bugs reported in the last month.

The complete changelog is the following:

  • Enhanced [#12154] (All): Added predefined variables for Solution Folder/Project Group Folder, Project Folder and Project Item Folder.
  • Enhanced [Internal] (VS/VBA): Documented in help file how to automate MZ-Tools to add line numbers, etc.
  • Enhanced [Internal] (All): Added Comment field to exception/error handler editor.
  • Enhanced [Internal] (VB/VBA): The External Utilities feature allows now to have two external utilities with the same command but different parameters.
  • Enhanced [Internal] (VB/VBA): The External Utilities feature shows now external utilities that use project or file parameters on the context menu of project or file.
  • Fixed [#12170] (All): The Check for Updates feature could cause NullReferenceException if MZ-Tools was being unloaded.
  • Fixed [#12177] (All): Fixed typos in German localization.
  • Fixed [#12161] (VB/VBA): The Method Callers feature didn’t resolve correctly calls to properties that were made in continuation lines.
  • Fixed [#12181] (VB/VBA): The Sort Code Elements feature did not consider public the procedures or properties that lacked the Public keyword.
  • Fixed [Internal] (VB/VBA): The External Utilities feature didn’t show icons of external utilities on the Toolbars and Menus dialog.
  • Fixed [Internal] (VB/VBA): The end position of the body of a procedure was not correct if there was a blank line with spaces after the procedure.
  • Fixed [Internal] (VB6/VB5): The icons of external utilities disappeared after showing the Options window twice.

MZ-Tools 8.0.0.158 released with several enhancements and bug fixes

Last May 1 a new monthly build of MZ-Tools, 8.0.0.158, was released. This build continues improving the updating experience initiated some builds ago: first, it provides again a “Download Only” button for those of you who don’t want the new automated update and prefer a manual installation as before. Second, in the automated update, it prevents in many cases the error that happened when some dll was in use, asking you to close the instance of the IDE before updating. And third, it reopens automatically the IDE and the loaded project when the update is finished.

In this build the headers review shows the first line of a header template that causes that the existing header no longer matches that template, which is useful to know why a header review is not passing. It also provides a context menu entry for the Insert Error Handler (VB) or Insert Exception Handler (Visual Studio).

It also introduces a change, in the form of a new requirement: .NET Framework 3.5 (previously only .NET Framework 2.0 was required). But in most cases you won’t need to install it because Windows 7 provides it and on Windows 10 only MZ-Tools 8.0 for Visual Studio 2005 will require it, but not MZ-Tools 8.0 for VBA/VB6/VB5. This new version of the .NET Framework will allow MZ-Tools in the future to use internally better APIs and externally new UI technologies (such as WPF).

Finally, this build fixes quite a few bugs that you have reported during the last month.

The complete changelog is the following:

  • Changed (VS 2005): .NET Framework 3.5 is now required if not running on Windows 7.
  • Changed (VBA/VB6/VB5): .NET Framework 3.5 is now required if running on Windows XP / Vista.
  • Enhanced [#12069] (All): The context menu of the code window now provides the “Insert Exception Handler” / “Insert Error Handler” meny entry.
  • Enhanced [#12113] (All): Added new predefined variable Type Tag With Upper Case ($P[TYPE_TAG_WITH_UPPER_CASE]), useful if your constants use upper case and include a type tag.
  • Enhanced [#12065, #12070, #12071] (All): The setup now shows a better message to close the IDE that is locking a file when updating.
  • Enhanced [#12065, #12070, #12071] (All): The setup now reopens the IDE and project or Office document that was open before closing it for updating.
  • Enhanced [Internal] (All): The Headers Review now shows the line of the header template that causes that the reviewed header doesn’t match it.
  • Fixed [#12068] (VBA): The Code Explorer didn’t respond to changes in the active file after unlocking a password-protected database. Now clicking the Refresh button starts responding.
  • Fixed [#12032] (VBA): In the Control Name Assistant, the Tab key inserted a Tab character in the textbox if a message box was shown (such as invalid name or state loss).
  • Fixed [#12081] (All): System.IO.IOException was not handled gracefully when deploying options files to a folder.
  • Fixed [#12090] (All): The Browse Folder dialog caused COMException 0x80040111 on Windows 7 if themes were deactivated.
  • Fixed [#12096] (VB/VBA): The Headers Review failed in some cases using user-defined variables.
  • Fixed [#12106] (All): The Programming Rules Review didn’t locate the exact code when using the “Any of these values” option instead of the “This value” option and didn’t show all violations.
  • Fixed [#12103] (VBA): The type tag editor and other features didn’t show 32-bit type libraries when using the 64-bit VBA editor.
  • Fixed [#12133] (VS): Shared projects were not supported.
  • Fixed [#12123] (VB6/VB5): Several features such as Find Text could crash a project if it contained many forms due to a leak.
  • Fixed [Internal] (All): The Headers Review didn’t review if there was more text or lines after the lines of a valid header.
  • Fixed [Internal] (VBA): Several features didn’t work correctly with the Page control in some versions of Office.
  • Fixed [Internal] (VBA): The Check for Updates feature of the portable edition offered the Install button when it should offer only the Download button.
  • Fixed [Internal] (VS): Icon of Keyboard Shortcuts in Options window was not correct when using the dark theme.
  • Fixed [Internal] (All): The Programming Rules Review didn’t show a friendly message if some regular expression was not valid.
  • Fixed [Internal] (All): The Programming Rules Review didn’t work in some scenarios using the Any Code Element rule kind.

MZ-Tools 8.0.0.149 released with several enhancements and bug fixes

Yesterday a new build 8.0.0.149 was released. This new build introduces two new columns, Access and Kind, in the Code Explorer:

It also provides a more streamlined updating experience that installs directly the new build without having to download the new setup, save it, locate it, run it, etc.:

There is also a new setting to choose whether to add blank lines or not in the New Method / Property Assistant (previously blank lines were always added):

The complete changelog is the following:

  • Enhanced [#11991] (All): The license file can now be replaced in the About window.
  • Enhanced [#11990] (All): The code element name is now shown in the caption of the Code Template User-Defined Variables Values dialog.
  • Enhanced [#12002] (VB/VBA): Added option to insert or not blank lines in code generated by the New Property/Method Assistant feature.
  • Enhanced [#12003] (VB/VBA): Added scope and kind columns to Code Explorer.
  • Fixed [#11910] (All): The setup shows now an error message to close the IDE that is locking a file.
  • Fixed [#11972] (All): The Options files were not read again once the connectivity with the drive that contained them was restored (USB drive, network folder, VPN, etc.).
  • Fixed [#11975] (All): The Code Explorer could cause NullReferenceException.
  • Fixed [#11993, #11594, #10722] (VBA): The Dead Code Review could cause COMException (0x800A9C68) when retrieving the Name property of a UserForm.
  • Fixed [#12005] (VS 2015): The Dead Code Review could cause System.InvalidOperationException “Ildasm File Full Name is null”.
  • Fixed [#12032] (VBA): The Tab key doesn’t work correctly in the Control Name Assistant. This bug was introduced in build 8.0.0.39
  • Fixed [#12020] (VB/VBA): The Sort Code Elements feature didn’t allow conditional compilation directives inside properties.
  • Fixed [#12037] (VB/VBA): The New Method/Property Assistant failed when used on a class whose name started with “I” because it is an interface.
  • Fixed [#12036] (VS): The line numbering feature of VB.NET didn’t exclude lines starting with the “Into” keyword.
  • Fixed [Internal] (VS): Some windows were not shown correctly with the Dark theme. This bug was introduced in non-public build 8.0.0.136.
  • Fixed [Internal] (VS/VBA): The Next Item button on the Control Explorer toolbar didn’t have the correct size in high DPI displays.
  • Fixed [Internal] (All): The icons in the explanation zone of the Options window didn’t have the correct color depth.

MZ-Tools 8.0.0.144 released with several enhancements and bug fixes

Today a new build 8.0.0.144 of MZ-Tools has been released with some bug fixes and several important enhancements thanks to your feedback, including a feature of MZ-Tools 3.0 that was not available yet on MZ-Tools 8.0: the ability to save files at debug-time (with a keyboard shortcut). New File/Method properties such as CodeLineCount, CommentLineCount, BlankLineCount, etc. (and the equivalent ones as percentages) have been added to the programming rules review, so that you now can create rules of the type “If you create spaghetti code, at least comment it profusely” :-). If you are a VBA user, toolwindows such as the Code Explorer now refresh automatically when the active window changes. The Insert Header is now more usable: there is a new menu entry on the context menu of the code window, and to insert a header to a file you can now put the cursor at any column of line 1 (not at column 1 as before). Also, the headers can use now two new predefined variables to define a section for the return value of a method or property. The whole section is deleted if the method doesn’t return a value, so you can define a unified header for Sub and Function methods. Finally, this build introduces a more streamlined experience in the Check for Updates feature requiring fewer clicks to update (you will notice this in the next monthly build).

The complete changelog is the following:

  • New (VB6/VB5): Keyboard shortcut to save file at debug-time (this feature was in MZ-Tools 3.0).
  • Enhanced [#11944] (All): Added the following properties to the Programming Rules Review: LineCount (formerly CodeLineCount, which changes the meaning), CommentLineCount, BlankLineCount, CodeLinePercentage, CommentLinePercentage, BlankLinePercentage.
  • Enhanced [#11910] (All): The check for updates process requires now fewer clicks to install the latest version.
  • Enhanced [#11924] (All): The context menu of the code window now provides the “Insert Header” meny entry.
  • Enhanced [#11857] (VBA): Toolwindows (Code Explorer, TabIndex Assistant, etc.) are now refreshed automatically when the active window changes.
  • Enhanced [#11924] (VB/VBA): The Insert Header feature now allows the cursor on any column of line 1 when inserting a class or module header.
  • Enhanced [#11946] (All): Added predefines variables “Method Return Section Begin” and “Method Return Section End” to exclude information about the return type in headers for methods that don’t return a value (“void” in C#, “Sub” in VB, etc.).
  • Enhanced [Internal] (VBA): The portable edition provides the option to isolate or not MZ-Tools, and the Com Shim provides better diagnostics.
  • Fixed [#11957] (VBA): The scope “Open files” didn’t work if the filename contained the “-” character.
  • Fixed [#11902] (All): In the dialog to enter the values of user-defined variables, if the value of a user variable was long enough to show the horizontal scrollbar in the preview richtextbox, the textbox with the value lost the focus.
  • Fixed [#11920] (All): NullReferenceException could happen in some circumstances.
  • Fixed [#11899] (VB/VBA): The Initialize and Terminate methods of classes were not shown in Code Explorer, and no icon was shown for them in the results window. This bug was introduced in build 8.0.0.135.
  • Fixed [#11903] (VB/VBA): Some features such as the Line Indenter caused error with comments that included again the comment character. This bug was introduced in build 8.0.0.135.
  • Fixed [#11958] (VB/VBA): The Insert Error Handler and other features don’t work correctly if the method declaration contains optional parameters initialized with dates or quotes that include the ‘:’ character.
  • Fixed [#11901] (VS): The Results window didn’t locate correctly variables declared with the same name in different blocks of the same method.
  • Fixed [Internal] (VB5/VB6): The main toolbar didn’t show all the buttons when using a resolution of 1280 horizontal pixels due to the new Code Explorer button. Now the Collapse Projects button has been moved to the Other Utilities toolbar. This bug was introduced in build 8.0.0.130.
  • Fixed [#11947, #11954] (VB/VBA): The Code Explorer could cause System.Runtime.InteropServices.COMException (0x80020010): Invalid callee. (Exception from HRESULT: 0x80020010 (DISP_E_BADCALLEE)).

MZ-Tools 8.0.0.135 released introducing enhanced programming rules reviews, enhancements and bug fixes

Today a new build 8.0.0.135 of MZ-Tools has been released with some bug fixes and interesting enhancements:

The Programming Rules Review now shows all violations of rules that use the “Not Containing” and “Not Matching” operators. So, for example, if you don’t want to use the Static modifier in procedure variables, now you get all the occurrences, not only the first one:

More importantly, the Programming Rules Review now allows to define a programming rule that is quite requested: if the code of a method (or module) contains some expression, then the code of that method (or module) must contain also some other expression. For example, if a method opens a recordset, it must close that recordset (or set a variable to Nothing). How this is done will be the subject of a separate post.

For VB/VBA, the Code Explorer and other features now distinguish between procedures that are subroutines (Sub) and procedures that are functions (Function). Notice the new icons and the separate filters:

The Options dialog now uses a more modern dialog to select a folder, that allows you to type (or paste) the full path to the folder:

The complete changelog is the following:

  • Enhanced [#11869] (All): The Programming Rules Review now allows regular expressions backreferences in the Value field of a condition for captures in the value field of a When condition.
  • Enhanced [Internal] (All): The Programming Rules Review now shows all violations using the “Not Containing” and “Not Matching” operators.
  • Enhanced [#11837] (All): On Windows Vista or higher you can now type the location of the options files, with a new folder browser dialog.
  • Enhanced [#11874] (VB/VBA): Features that deal with procedures now distinguish between Subs and Functions.
  • Fixed [#11886] (All): The Private Clipboards dialog now allows to click the OK button by keyboard using Alt+O.
  • Fixed [#11863] (All): The Find Text feature didn’t allow regular expressions when using Multiline.
  • Fixed [#11883] (VB/VBA): The Statistics feature now includes only text files that are recognized text files or parents of code files.
  • Fixed [#11880] (VB/VBA): Event handlers were considered dead code if used all lower case.
  • Fixed [#11866] (VBA): The Insert Header feature can cause NullReferenceException when used with CSS files (which are unsupported).
  • Fixed [#11845] (VBA): The Line Indenter didn’t parse correctly lines with the space + comment character sequence inside a string.
  • Fixed [#11825] (VBA): After inserting a code template, the code window didn’t get the focus.
  • Fixed [#11837] (VBA): On Windows Vista or higher you can now type the location of the options files, with a new folder browser dialog.
  • Fixed [#11858] (VBA): The Database Connection Assistant didn’t show the connection string with the MySQL ODBC driver.
  • Fixed [#11894] (VBA): The scope “Open files” didn’t work in Microsoft Access.
  • Fixed [Internal] (All): The Programming Rules Review caused exceptions if invalid regular expressions were used.

MZ-Tools 8.0.0.130 released introducing a Code Explorer and drag & drop in TabIndex Assistant

Last January 1 another monthly build was released, 8.0.0.130. This time, apart from some bug fixes, it introduces a new feature: a file code explorer:

You can read more about the Code Explorer on this post: Moving from MZ-Tools 3.0 to 8.0 Part 32: A Code Explorer.

Also, support for drag & drop in the TabIndex Assistant is reintroduced (this was supported in MZ-Tools 3.0, but not in MZ-Tools 8.0 until now).

The complete changelog is the following:

MZ-Tools 8.0.0.130 released (January 1, 2017)

  • New (VB/VBA): Code Explorer.
  • Enhanced [#11723] (All): Added support for drag & drop in TabIndex Assistant, Switch Assistant and other listviews.
  • Fixed [#11779] (All): The Programming Rules Review didn’t locate results using regular expressions when the found text ended with carriage return without line feed.
  • Fixed [#11775] (All): The Code Element Headers Review caused “Unterminated [] set” with headers that included parameters of array types.
  • Fixed [#11750] (All): The Generate HTML documentation could cause System.Xml.XmlException: hexadecimal value is an invalid character.
  • Fixed [#11739, #11749, #11757] (VB/VBA): The language of the user interface was always English on Windows 7. This bug was introduced in build 8.0.0.120.
  • Fixed [#11766] (VS): The New Method/Property Assistant added quotes to the initial value String.Empty.
  • Fixed [#11804] (VBA): The Find feature could cause System.ArgumentOutOfRangeException when using the VBA editor with double-byte encondings.
  • Fixed [Internal] (VB): The Generate Documentation (XML/HTML) could cause System.NullReferenceException (“System Error &H80004003. Invalid pointer”) if the operation was executed twice.
  • Fixed [Internal] (VBA): The width of buttons on toolbars was not correct when using high-DPI displays.

Moving from MZ-Tools 3.0 to 8.0 Part 32: A Code Explorer

The build 8.0.0.130 released on January 1, 2017, introduces another very requested feature: a Code Explorer. This feature provides you a list with all the code elements of the active code window:

The Code Explorer shows the code elements of the following kinds:

  • Constants
  • Fields
  • Enums
  • Events
  • User-Defined Types
  • Properties
  • Methods

On the toolbar there are seven toggle buttons to show/hide the code elements of a particular kind. Here you can see the Code Explorer showing only fields:

Furthermore, to the right of the toolbar you have a textbox to enter any text, so that only the code elements containing that text are shown:

And selecting any code element in the list shows it in the code window. I hope that you find this tool productive to locate your code faster!

MZ-Tools 8.0.0.116 and 8.0.0.120 released with VS 2017 RC support and bug fixes

The past November 16 a new build 8.0.0.116 was released with some bug fixes and, more importantly, with support for the Visual Studio 2017 Release Candidate 1 announced by Microsoft at the Connect(); 2016 event.

Today a new build 8.0.0.120 has been released with new bug fixes, one of them specially important if you are using Visual Basic 6.0 since the Rename Related Source Code feature was crashing usercontrols.

Also, this month the MZ-Tools website started to use https and this caused a problem in the Check for Updates feature that is now fixed.

The changelogs are the following:

MZ-Tools 8.0.0.116 released (November 16, 2016)

  • New (VS): Added support for VS 2017 RC.
  • Fixed [#11691] (All): The Generate HTML Output Documentation removed indentation of comments in headers.
  • Fixed [#11662] (All): The Dead Code Review didn’t parse correctly statements that were not Dim declarations in lines that started with Dim declarations.
  • Fixed [#11670] (VB/VBA): The Replace feature could cause System.ArgumentOutOfRangeException “Index and length must refer to a location within the string” could happen in some cases.
  • Fixed [#11666] (VBA): LongLong and LongPtr types were not recognized.
  • Fixed [#11695] (VBA): The TabIndex Assistant and other features duplicated a control if the parent was a Frame control inside another Frame control.

MZ-Tools 8.0.0.120 released (December 1, 2016)

  • Fixed [#11715] (All): The Check for updates feature caused “http://www.mztools.com/v8/latestversion.txt” not found because of https.
  • Fixed [#11716] (All): The Review Code Element Headers could cause System.ArgumentNullException “Value cannot be null”.
  • Fixed [#11724] (All): MZ-Tools entry is no longer created in Control Panel > Programs and features if silent switches are used for automated deployments.
  • Fixed [#11703, #11704] (VB6): Custom control crashed when renamed if the “Rename Related Source Code” feature was activated.