Upgrading from Visual C++ v7.1 (VS 2003) to Visual C++ v9 (VS 2008)

Posted March 14th, 2008 by kyle
Categories: development, Visual Build

VC6

Our applications are written primarily in Visual C++. We started with Visual C 6.0 back in 1998 and used it successfully for many years.

VC7

There was quite a bit of disappointment among C developers with the release of Visual Studio .NET (VC7) in 2002 and VS .NET 2003 (VC7.1) the following year because of so much emphasis placed on the new .NET Framework and VB.NET and C# languages. But with some trepidation and a moderate amount of pain, we finally migrated to VC7.1 in mid-2005. Other than some quirks in the resource editor that we managed to work around, that version worked well for us (with the requisite additions of Visual Assist and Fast Solution Build add-ins). It brought much-needed improvements to standards compliance, some library improvements, and was fairly stable, although compilation was a little slower and the executables slightly larger than VC6.

VC8

In early 2007, we experimented with upgrading to Visual Studio 2005 (VC8) but ran into a lot of problems attempting to get everything to compile and link properly. Microsoft also made some changes to how LIB files are handled, and one third-party library we use did not offer a VC8-compatible library at the time, so we shelved the conversion.

With Microsoft readying the release of Visual Studio 2008 (VC9) and the availability of VC8-compatible third-party libraries, we decided it was time to attempt migrating one more time. We thought it would be easier to convert to VC8 first and then try VC9 after that, but boy did that turn out to be a poor assumption.

VC8 didn’t do a great job of converting our project and solution files, requiring manual correction (Build checkboxes in the Configuration Manager and dependencies getting dropped). We also ran into several compilation and linker issues to work through, including:

  • Several code changes were required to eliminate warning messages related to using the new safe CRT functions calls, etc.
  • Had to increase the compiler limits (/Zm) on some projects
  • Warning for non-standard extension used in qualified name for enums
  • Disabled manifest generation and embedding (since our executables already include a manifest)

    Thanks to Visual Build’s built-in support for all Visual Studio releases, updating our builds was painless (only needing to append ‘|Win32′ to the solution configuration names).

    Once we finally got everything to compile and link, we ran into several runtime problems and had to make some more changes, primarily:

  • Avoid referencing &elem[0] of empty vectors (it’s safe to pass that to memcpy with a length of 0, for instance, but VC8 aborts the program just by referencing the element)
  • Make changes to bring STL iterator code (which assumes they are pointers) into compliance

    Most problems were identified quickly and corrected in the debug build, but even with these changes, we ran into two show-stoppers:

  • Choosing one feature in one of our applications resulted in the app just disappearing, and this only occurred in the release build on a Windows 2000 box.
  • Command-line builds worked fine, but compiling almost any file in any project within the Visual Studio IDE resulted in the dreaded internal compiler error (ICE), which made development and debugging unbearable.

    VC9

    We were about to give up and stick with VC7.1, but as a last-ditch effort, we decided to try migrating everything to VC9. We encountered a few more compilation issues:

  • Some of our projects defined a minimum Windows version of NT 4 (_WIN32_WINNT 0×0400), which now resulted in compile errors, but changing this to Windows 2000 (0×0500) fixed that and is safe since our applications require Windows 2000 anyway
  • The 64-bit portability check compiler flag is deprecated so we removed that directive from the project files
  • MFC no longer handles including of afximpl.h very nicely, so we just copied the few lines of code we used from that file into our own sources and removed the include

    After these changes, low and behold, we found that everything worked just great! No more crashing of the compiler when building in the IDE, and no more problems running our application on Windows 2000. Our executables are larger still (about 10%), which is acceptable considering all the improvements that have been added to make the code more secure in our connected world.

    It’s apparent that Microsoft has really put significant effort into improving their C tool chain with this release of Visual Studio, and there are many great IDE improvements as well:

  • The debugger, especially peering into STL containers, has improved tremendously
  • The resource editor is improved and now handles high color bitmaps
  • VS/MSBuild now supports parallel builds on multi-core and multi-CPU systems (and builds do appear to be noticeably faster on such systems)
  • New features like testing, optimization, code snippets, and property manager capabilities
  • Easy backup, restore, and sharing of IDE settings

    One caveat that bit us: Visual Studio 2008 requires Windows XP or later, and our build boxes were all Windows 2000, so we had to reconstruct the build machines. There is also a quirk with the Visual Studio 2008 Standard edition installer — it doesn’t install cl.exe and some ancillary files unless you perform a full installation.

    Overall, it took longer than expected to complete the migration, but fortunately it turned out to be worthwhile in the end.

  • LaunchAssist: Improving Application Launchers Everywhere

    Posted November 15th, 2007 by kyle
    Categories: software, keyboarding, freeware

    None of the popular launcher applications, nor Windows itself, do a very good job of integrating launching vs. activating an already-running application. LaunchAssist is a little utility I wrote to improve this situation. It works with most application launchers as well as the Windows Start Menu, Run dialog, Explorer, etc. To install, download it here, extract it somewhere onto your hard drive, then register by double-clicking reg.bat (to uninstall, double-click unreg.bat, restart Windows, and delete the DLL). It works on Windows 2000, XP, and 2003, but unfortunately the hook that is needed for it to work was disabled in Vista (and despite what is stated in that thread, it can’t actually be fully enabled on Vista).

    When an executable, document, or shortcut is launched, LaunchAssist is notified, looks for a matching application that is already running (by comparing the application or document filename with the beginning and ending of top-level window captions), and activates the matching window if found. If no match is found or if Shift is held down while launching (Shift+Enter in most launcher apps), LaunchAssist is bypassed and the program is launched normally by Windows.

    Bonus feature: when launching URLs, if Shift is held down, LaunchAssist attempts to open the URL in a new browser window (for URLs, if Shift is not held down, LaunchAssist is bypassed). This is useful to me since I still use the venerable IE 6 (since I disdain tabbed browsers), configured to reuse windows when launching shortcuts, but sometimes I do want to open a new window instead. It works by finding the application associated with .html and launching it directly, which should work with most browsers.

    The Zen Of Windows Application Launching, Part 2

    Posted October 29th, 2007 by kyle
    Categories: software, keyboarding

    Several categories of Windows application launchers have evolved over the past several years. In this post, I’ll look at the best and most popular products in each category. I’m only going to mention products that are either quite stable or that have been updated recently.

    Auto-Config

    Products in this category typically provide a polished GUI, automatically track the shortcuts on your system (Start Menu, recently launched apps and documents, etc.), and are summoned via a single hotkey. Typing a few characters will filter from the list of installed applications to quickly find the desired the one to launch, and pressing Enter launches it. The idea is to avoid having to configure anything, and (hopefully) the application quickly learns your habits and remembers the best matches for frequently typed abbreviations.

    Many applications in this category also provide additional features (for instance, capture of selected text from current app, web search, inline calculator, auto-type from abbreviations, etc.) and support a plug-in architecture for user extensibility.

  • Colibiri
  • Dash
  • Find and Run Robot
  • Enso
  • Launchy
  • Single Key Launchers

    Launchers in this category provide a more basic interface (typically text-only and no icons) that is more like the Run dialog on steroids. They are also launched with a single hotkey, and filter on the text you type to identify user-defined abbreviations which launch an application, open a web page, etc.

  • Dave’s Quick Search Taskbar Toolbar Deskbar
  • Executor
  • Keybreeze
  • SlickRun
  • Start Menu Replacements

    These applications attempt to provide a better alternative to the Windows Start Menu.

  • Engage
  • JetStart
  • VistaStartMenu
  • Typing Activated

    Applications in this category provide a minimal user interface. Rather than summoning the application with a hotkey, you actually type into whatever application you’re in, and when the application identifies some abbreviation that you’ve defined, it pops up a confirmation prompt. Confirming the prompt erases the typed text from the current application and launches the application (or performs other functionality, such as typing boilerplate text) connected to that abbreviation.

  • Direct Access
  • Perfect Keyboard
  • Phrase Express
  • Some products overlap multiple categories. I’ll look more in depth at some of these applications in future posts. Some additional categories that I won’t explore are hotkey programs, full-fledged macro programs, programmable keyboards, toolbar (mouse-centric) applications, and voice-activated launchers.

    First Gmail Spam!

    Posted August 13th, 2007 by kyle
    Categories: internet, keyboarding

    A few months back, I switched from Yahoo! Mail to Gmail for my personal email account, primarily because of its excellent keyboard accessibility. Yesterday, I encountered the first spam message to erroneously end up in my Inbox. Compare that with Yahoo! Mail, where I averaged a couple of uncaught spam nearly every day. Very impressive filtering.

    Review: AB Commander

    Posted June 4th, 2007 by kyle
    Categories: software, reviews

    The built-in Explorer application in Windows is rather wimpy, and every power user soon looks for a decent replacement. I looked at dozens of alternatives before settling on AB Commander, a dual-pane Explorer replacement.

    AB Commander’s dual-pane view suits me well, since I often need to deal with two folders at a time, but rarely more than that. In contrast to Explorer, AB Commander is very keyboard friendly, providing shortcuts for almost every activity (although the shortcuts are not customizable). No matter where you are, navigating is very quick:

  • Enter navigates into a folder
  • Backspace navigates back a level; Alt+Backspace navigates to the root of the current drive
  • For every folder that is visited, it remembers and reselects the subfolder that was previously selected
  • Alt+Left and Right Arrow go forward and back in the navigation history
  • Ctrl+D, letter navigates to a given drive
  • Alt+D or Ctrl+J can be used to navigate directly to a folder (and provides a drop-down list of recently accessed folders)
  • Ctrl+G displays a list of common and recent folders for navigating directly to
  • Ctrl+H displays the history of recently accessed folders
  • Ctrl+O shows a list of favorite folders
    AB Commander does a good job of leveraging the existing Windows shell rendering and navigation capabilities while adding lots of functionality that is missing from Explorer itself. It can also completely replace Explorer for most shell integration (display virtual folders, take over Windows+E shortcut and association with folders, show regular Explorer context menu, etc.). Some of the additional features I use frequently include filtering, favorites, history, quick editing, and drive and new folder shortcuts.

    AB Commander has been very stable for me on Windows XP, the latest release supports Windows Vista, and an x64 edition is also available. If you’re looking for a Windows Explorer replacement, AB Commander should be on your list to evaluate.

  • Managing a journal with Ultra Recall…

    Posted March 30th, 2007 by kyle
    Categories: Ultra Recall

    A new sample has recently been added to Ultra Recall, called Journal.urd. While Ultra Recall can do much more than just managing a journal, it is very good at the task, which this sample highlights. The sample demonstrates using templates and other Ultra Recall features, and contains a pre-configured journal hierarchy. A flash tutorial about managing a journal in Ultra Recall is also available here.

    The Journal.urd sample shows one method of creating a journal hierarchy in Ultra Recall, but you are certainly not constrained to this design, the flexibility of Ultra Recall allows limitless configurations. The sample uses three custom templates (Year, Month, and Journal Entry), which makes it very simple to add Journal Entries which are organized by Year and Month, yet be fully searchable. Custom icons were assigned to the different templates which further highlights the different parts of the journal.

    There are many reasons why Ultra Recall is a great application for a journal:

  • All data is stored in a single file: this makes it very easy to backup, or transport your journal
  • Strong password encryption: a single password will ensure your journal is secure, even if it is located on a USB drive or other transportable media
  • Powerful and flexible search capabilities: as your journal grows, you will have the confidence that you can find the information if you need to
  • Automatic spell-checking: similar to the spell-checking available in Microsoft Office, this feature helps you avoid typos
  • Custom templates: this feature is demonstrated in the sample, and is used to add structure and convenience to your journal experience
  • Ability to add supporting information (documents, emails, web pages, etc): this is the real beauty of Ultra Recall, it can function as a regular outlining application, but also has the flexibility to do much more, by storing essentially anything!
  • Logical Linking: if you can’t decide what a topic is relatd to, this technology will let you link it to them all! Very handy in a topical hierarchy like a journal
  • No limits on journal size: since Ultra Recall uses the SQLite embedded database engine, it provides high performance with consistent performance regardless of file size. You won’t be constrained to any artificial organization limitations with Ultra Recall!
  • Other applications can be used to manage a journal, but Ultra Recall excels at the task, while offering many additional capabilities. Ultra Recall quickly becomes indispensable, by managing your scheduled tasks; archiving your emails, documents, web pages and text together, organized topically, chronologically, etc; then facilitating the recall of everything added with powerful search capabilities.

    Give Ultra Recall a try today!

    The Zen Of Windows Application Launching, Part 1

    Posted March 22nd, 2007 by kyle
    Categories: software, keyboarding

    Launching and switching between applications are two very common activities when using Windows. Keyboard aficionados will naturally seek to minimize the work involved in such common tasks. For launching applications, Windows provides the Start Menu (accessed from the keyboard via the Windows key or Ctrl+Esc), the Quick Launch toolbar (Win+Tab, Tab), desktop shortcuts (Win+D), and the Run dialog (Win+R). For managing running programs, Windows provides the Taskbar (Win+Tab) and Alt+Tab window. Other than a few innovations in the Start Menu, such as recent and pinned items and highlighting of recently installed programs, little changed in these features between Windows 95 and Windows 2003. They aren’t the most robust implementations:

  • The Start Menu tends to end up as a cluttered, unordered mess that nobody wants to waste their time wading through. The recent/pinned items help, but only in some circumstances.
  • The Alt+Tab window only supports navigating one item at a time via Alt+Tab or Alt+Shift+Tab.
  • Quick Launch and the Taskbar are not really very quick for keyboard fanatics.
  • The Run Dialog isn’t resizable, only remembers the last 30 items entered, and doesn’t show icons.
  • Each feature is isolated, requiring extra thought on the user’s part to decide/remember which keystroke or place to look for each operation.
    Windows Vista did make some improvements in this area, but not enough to get very excited about.

  • The Start Menu provides a search capability, which is a big improvement, but it is fairly limited compared to other implementations (searches only match on contiguously typed characters, so ‘internet’ or ‘explore’ can be used to find Internet Explorer, but not ‘ie’ or ‘iexp’; there is no memory of abbreviations to your choice of a match [for instance, to ensure that ‘oe’ always matches Outlook Express after you choose it even if something else matched first initially], etc.).
  • Alt+Tab shows thumbnails and can be navigated via arrows keys and Home/End, but it still doesn’t provide a way to group related windows.
  • The flashy, but not very useful, Flip 3D (Win+Tab) has been added (taking away quick keyboard access to the Taskbar).
  • Each feature is still separate, rather than being unified into a more intuitive design.
    These limitations have, of course, spawned a whole cottage industry of products that attempt to improve on various aspects of launching and switching between applications. These days, there are literally dozens of such applications available that take various approaches to solving the problem. I’ve evaluated and used many of them in my ongoing quest for the ultimate in application launching and task switching, and I’ll be reviewing some in future blog posts.

    In my opinion, one of the biggest problems is that there are simply too many ways to launch and switch between programs. These features need to be unified. You shouldn’t have to use Quick Launch or the desktop for common applications but then hunt through the Start Menu for less common programs, or distinguish between launching a program vs. switching to an already-running application, etc. Surprisingly, with all of the programs that are trying to fill this void, nobody has yet managed to combine these capabilities into a single, intuitive interface.

  • Ultra Recall as a Data Archive

    Posted January 30th, 2007 by kyle
    Categories: Ultra Recall

    One of the great things about Ultra Recall is that it is flexible enough to be used for a variety of purposes (of course, that very flexibility makes it a bit challenging to market, and that’s one of the reasons for this blog).

    One use that Ultra Recall excels at is data archiving. Here at Kinook, we file all of our business documents, including emails, invoices, purchases, faxes, tax documents, and more, in an Ultra Recall database. The database is located on the network for easy access by multiple users and so that it gets included in our nightly backup process.

    Whenever someone needs to lookup any information, the database can be quickly opened and instantly searched by name, email address, subject, any text in the stored documents, or other attribute (metadata) values. One benefit of archiving this information in one database is that we only have to look in one place, regardless of what type of data we might be looking for. We use both Outlook and Outlook Express for email, but since Ultra Recall can store both types of messages, we can locate any email message (as well as Word, PDF, and other documents) in one step.

    Another benefit is that we only have to backup one file to ensure that all of our data can be recovered if and when our server’s hard drive goes south. We don’t have to mess with backing up users’ personal email and document folders, and everyone can easily access the documents.

    Review: TouchCursor

    Posted December 28th, 2006 by kyle
    Categories: software, reviews, keyboarding

    As an avid keyboarder, one thing that has always slowed me down is having to move my hands to reach for the navigation keys (arrow keys, home, end, page up/down, etc.). Methods to reduce the problem are available (for instance, space bar scrolling in browsers, special navigation modes in editors like vi/vim, etc.), but they are all application-specific. I’ve always wished for a vim-style navigation capability that worked everywhere in Windows.

    Rare Pebble Software has created an ingenious solution to this problem: TouchCursor is a simple Windows application that turns your Space bar into another shift-state key, allowing you to combine it with home row keys for navigation and other common keystrokes.

    For instance, by default Space+J is bound to left arrow, Space+L to right arrow, Space+K to down, Space+I to up, etc. Regular shift states (Ctrl, Alt, Shift, Win) can be combined with Space to type almost any combination from the home row. It sounds a bit odd, but it works surprisingly well. Note that it does work differently than a separate mode (ala vim).

    The key bindings can be customized as desired. I like the defaults that are provided for the right hand, and I’ve also added bindings for other hard-to-reach keys like Esc and the function keys. Now my hands hardly ever need to leave their home positions.

    A training mode is provided, and it only takes a few days to get into the habit of using the TouchCursor key combinations. TouchCursor is also a boon for use on laptops, which tend to have funky layouts for the navigation keys.

    It even works inside Remote Desktop sessions and guest virtual machines (Virtual PC and VMware) without having to install it on the remote/guest systems!

    Once you start using it, you’ll never want to use a computer where it isn’t installed, and TouchCursor can run from a USB drive, making it easy to take it wherever you go. If you want to become more efficient at the keyboard, TouchCursor will be a welcome addition to your system.

    Windows Vista Keyboard Annoyances

    Posted December 12th, 2006 by kyle
    Categories: Windows, keyboarding

    Vista adds some neat new behaviors for mouse users, but keyboard users seem to have taken a back seat. Just a few annoyances I noticed after using Vista for a few hours:

    #1: Vista adds a new “message box on steroids” called the task dialog. It adds some sorely-needed features, but unfortunately, one handy Windows feature (common to message boxes and dialogs containing only buttons and labels) that it doesn’t implement is the capability to make a selection via a mnemonic letter without using the Alt key. For instance, the UAC dialogs are task dialogs and have choices like Allow or Continue, but you must press Alt+A or Alt+C to select those choices rather than A or C by itself.

    #2: Too many tab stops to navigate panes in Windows Explorer (4 in XP vs. 8 in Vista), and the tab order is not intuitive (for instance, the list view precedes the column headers). Dedicated keys to jump directly to each pane are sorely needed.

    #3: When launching an application from an Explorer view and a UAC prompt is displayed, when returning to the Explorer view, the keyboard focus is lost and you must tab 6 times to get focus back to the file list view.

    #4: More steps to log off. Windows Vista: Windows, Right, Right, Right, L. Windows XP: Windows, L, Enter.


    Bad Behavior has blocked 2242 access attempts in the last 7 days.