LearnVSXNow! (about Visual Studio packages), by Istvan Novak (DiveDeeper’s blog)

MVP fellow Istvan Novak wrote long time ago a long series of small articles about Visual Studio Extensibility (VSX) with packages on his DiveDeeper’s blog.

I have added a new section to my Resources about Visual Studio .NET extensibility page with sorted links to all of them:

LearnVSXNow!, by Istvan Novak (DiveDeeper’s blog)
http://www.mztools.com/resources_vsnet_addins.aspx#LearnVSXNow

Back from Microsoft Tech / Community Day 2012 Madrid

I’m back from the Microsoft Tech Day / Community Day 2012 at Madrid, which have been great. The aspect that I like most is networking with people, either old MVPs that I already know, new MVPs or other people.

In this event I was introduced to Jesús Salas, the author of VS Anywhere, also available on the Visual Studio Gallery, an extension for Visual Studio that provides team collaboration in real time with a very innovative approach.

I also met my friend Pep Lluis Baños, Visual Basic MVP like me, who brought to the event an intriguing kind of electronic mini motherboard that happened to be the mainboards used in .NET Micro Framework, a technology that I only knew the name. Since I returned, I have been so excited about this technology that I have watched the Gadgeteering and the .NET Micro Framework video, I have read documentation, I have bought the Getting Started with .NET Gadgeteer book that I am reading and I do plan to buy some .NET Gadgeteer Starter Kit for Christmas to start playing. It’s great also to see how powerful and flexible Visual Studio and the .NET Framework have become to accommodate all kind of extensions with project types, visual designers for electronic layouts, debuggers with external devices, etc.

The strange case of error “Unable to register DLL/OCX:RegSvr32 failed with exit code 0x5”

In the past years, I have received some bug reports (less than 10 out of dozens of thousands of installations) reporting that the setup of MZ-Tools 3.0 for VBA / VB6 was failing with this error:

“Unable to register DLL/OCX:RegSvr32 failed with exit code 0x5”

I never discovered the cause (I just recommended to reinstall Office or VB6, depending on the case, or I sent the list of dependencies), but in the last weeks the problem has happened to two users of Microsoft Office 2013 using a clean installation. I already suspected that the problem was related to the file MSADDNDR.DLL (in the folder C:\Program Files (x86)\Common Files\designer), the reference used by add-ins for VB6 and for the VBA editor.

So I decided to investigate, and lo and behold, it happens that Office 2013 doesn’t install that file, it just installs the MSADDNDR.OLB object library file. I even used the orca.exe tool of the Microsoft Windows SDK to open the .msi files of the Office 2013 setup to verify. I guess that somehow some users of VB6 and old versions of Office had this file missing or damaged, what would explain the case completely.

To fix the problem, the new setups of MZ-Tools 3.0 released today install this file:

MZ-Tools 3.0.1206 for VBA with bug fix to support Microsoft Office 2013
http://www.mztools.com/blog/mz-tools-3-0-1206-for-vba-with-bug-fix-to-support-microsoft-office-2013/

Red Gate Blog Guest post: Using .NET Reflector to understand and debug Visual Studio assemblies

After I wrote this post about using .NET Reflector to debug Visual Studio assemblies,

Guest post: Using .NET Reflector to understand and debug Visual Studio assemblies
http://reflectorblog.red-gate.com/2012/10/guest-post-using-net-reflector-to-understand-and-debug-visual-studio-assemblies/

Adopting Visual Studio 2012

Finally today, after much reluctance in the past weeks, I have decided to adopt Visual Studio 2012 as the development environment for all my Visual Studio solutions, and I have just migrated them. I still find the default Light theme unpalatable but the Visual Studio 2012 Color Theme Editor extension provides much more pleasant themes and you can even switch themes with a couple of clicks.

What prompted me to the move was that Packt Publishing gave me a copy of the book Visual Studio 2012 Cookbook of fellow MVP Richard Banks to write a review and after reading the first chapter about the new IDE enhancements in the Solution Explorer and Tab Well I realized they were too good to miss the opportunity to use them on a daily basis.

MZ-Tools Articles Series: HOWTO: Get an inverted bitmap to use with the Dark theme of Visual Studio 2012 from an add-in.

There is a feature in my MZ-Tools add-in that requires to show the pictures of its commands in a treeview, to select which ones to be visible or not. When using Visual Studio 2012 and the Dark theme, the background of the form and the treeview are darked, and the bitmaps should have inverted colors.

I wanted to reuse the command pictures and use a function that inverts their colors as VS 2012 does. I knew the ThemeDIBits method of the IVsUIShell5 interface, but it took me a while to discover a Visual Studio assembly that used it. Finally I found it and here is the approach:

HOWTO: Get an inverted bitmap to use with the Dark theme of Visual Studio 2012 from an add-in.
http://www.mztools.com/articles/2012/MZ2012030.aspx

The sample also shows how to get the background color of toolwindows, using also the IVSUIShell5 interface.

Note: my command pictures use the almost green (RGB=0,254,0) to denote the transparent color, and the sample provided uses that color, but you can use any color.

MZ-Tools Articles Series: HOWTO: Detect Visual Studio requirements for MSI-based extensions setups.

My new article in the MZ-Tools Articles Series is about Visual Studio extension setups (a digression from the “theming extensions” subject of my last articles). I learn something new very often from questions in the MSDN Visual Studio Extensibility (VSX) Forum, when I have to investigate something before providing an answer.

A few days ago a question led me to learn something new that I have documented here:

HOWTO: Detect Visual Studio requirements for MSI-based extensions setups.
http://www.mztools.com/Articles/2012/MZ2012029.aspx

While writing that article I noticed that I had to update a bit these old ones:

HOWTO: Detect installed Visual Studio editions, packages or service packs
http://www.mztools.com/Articles/2008/MZ2008003.aspx

HOWTO: Detect if Visual Studio .NET is installed in a Visual Studio Setup package for an add-in
http://www.mztools.com/Articles/2006/MZ2006001.aspx

MZ-Tools Articles Series: BUG: Visual Studio 2012 doesn’t theme multiline textbox with initial scrollbar on add-in toolwindow.

This is one of the bugs that I found while theming my MZ-Tools add-in with VS 2012 Dark / Light themes:

BUG: Visual Studio 2012 doesn’t theme multiline textbox with initial scrollbar on add-in toolwindow.
http://www.mztools.com/articles/2012/MZ2012028.aspx

UnthemedScrollbar

And here it is the bug that I have filed through Microsoft Connect to be fixed:

Visual Studio 2012 doesn’t theme multiline textbox with initial scrollbar on add-in toolwindow
https://connect.microsoft.com/VisualStudio/feedback/details/766960/visual-studio-2012-doesnt-theme-multiline-textbox-with-initial-scrollbar-on-add-in-toolwindow#details

Fortunately I found an easy workaround that I have mentioned in the article.

MZ-Tools Articles Series: HOWTO: Get the Microsoft.VisualStudio.Shell.Interop.IVsUIShell5 interface to theme a Visual Studio 2012 add-in.

Another building block that I have used to theme my MZ-Tools add-in with the Visual Studio 2012 Dark/Light themes:

HOWTO: Get the Microsoft.VisualStudio.Shell.Interop.IVsUIShell5 interface to theme a Visual Studio 2012 add-in:
http://www.mztools.com/articles/2012/MZ2012027.aspx

In a next article I will explain how to invert the colors of a bitmap like VS 2012 does.

MZ-Tools Articles Series: HOWTO: Theme scrollbars of controls on a Windows Forms modal window from a Visual Studio 2012 add-in.

I had pending for weeks to theme scrollbars of controls of my MZ-Tools add-in on modal forms (Visual Studio 2012 automatically themes scrollbars of controls on toolwindows) and finally yesterday I decided to devote some time to the investigation. Here is the answer:

HOWTO: Theme scrollbars of controls on a Windows Forms modal window from a Visual Studio 2012 add-in.
http://www.mztools.com/articles/2012/MZ2012026.aspx

VS SDK, packages, add-ins, macros and more…