Setting Global C++ Include Paths in Visual Studio 2012 (and 2013, and 2010)

Starting with Visual Studio 2010, Microsoft decided to make life hard on C++ developers.  System-wide include path settings used to be accessed through Tools | Options | Projects and Solutions | VC++ Directories.  However, that option is gone:

VS2012_ToolsOptionsDirectories

Instead, the system-wide include paths are now located within the ‘Properties’ interface.  To access it, select View | Property Manager.  No dialog will appear yet. Instead, the Property Manager appears as a tab along with the Solution Explorer:

VS2012_OptionsPropertyManager

Note:  The Property Manager won’t contain anything unless a solution is loaded.

If the Property Manager is missing, it can be shown by selecting View | Other Windows | Property Manager from the menu.

Now, expand one of your projects, then expand Debug | Win32 or Release | Win32:

VS2012_PropertyPageProjectExpanded

Right click Microsoft.Cpp.Win32.user and select Properties: VS2012_PropertyPageProjectExpandedMenu

This brings up the Microsoft.Cpp.Win32.User Property Pages dialog, which should look familiar enough:

VS2012_Win32UserPropertyPage

Alternate Access The properties can be accessed directly as an XML file by editing

%LOCALAPPDATA%\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props

VS2012_Win32UserPropsXML

Rant: None of this makes any sense whatsoever. Why do I have to have a solution loaded before I can edit the system-wide (technically user-wide) path settings?  The old system made sense: project-specific include paths were set in the properties of individual projects, and system include paths were set through the Tools menu. The layout is irritating, forgettable, and, most importantly, it makes absolutely no sense to access system settings by clicking through your own projects!

Posted in Technology, Windows | 3 Comments

How Do I Know What Ubuntu Version Number I Have?

lsb_release -a

Posted in Linux, Technology | Leave a comment

Console2 and Cygwin with Solarized Color Palette

If you want to use Ethan Schoonover’s Solarized color palette with Console2 and Cygwin, here’s how:

  1. Edit the console settings file at %LOCALAPPDATA%\Console2\console.xml or %APPDATA%\Console\console.xml.
  2. Replace the <colors> ... </colors> section with the following:
    <colors>
       <color id="0" r="7" g="54" b="66"/>         <!-- black -->
       <color id="1" r="38" g="139" b="210"/>      <!-- blue -->
       <color id="2" r="133" g="153" b="0"/>       <!-- green -->
       <color id="3" r="42" g="161" b="152"/>      <!-- cyan -->
       <color id="4" r="220" g="50" b="47"/>       <!-- red -->
       <color id="5" r="211" g="54" b="130"/>      <!-- magenta -->
       <color id="6" r="181" g="137" b="0"/>       <!-- yellow/brown -->
       <color id="7" r="238" g="232" b="213"/>     <!-- white -->
       <color id="8" r="0" g="43" b="54"/>         <!-- brblack --> 
       <color id="9" r="131" g="148" b="150"/>     <!-- brblue -->
       <color id="10" r="88" g="110" b="117"/>     <!-- brgreen -->
       <color id="11" r="147" g="161" b="161"/>    <!-- brcyan -->
       <color id="12" r="203" g="75" b="22"/>      <!-- brred -->
       <color id="13" r="108" g="113" b="196"/>    <!-- brmagenta/violet -->
       <color id="14" r="101" g="123" b="131"/>    <!-- bryellow -->
       <color id="15" r="253" g="246" b="227"/>    <!-- brwhite  -->
    </colors>
    
  3. Restart Console2.

Colors in vim look good:

Editing a CPP file in vim

Cygwin ls colors are a bit odd compared to other platforms:

Cygwin directory listing

Posted in Cygwin, Technology, Windows | 1 Comment

How to Build Microsoft Detours Express (32-bit) on 64-bit Windows

Microsoft Detours Express, which is 32-bit only, can still be built on 64-bit operating systems. Here’s how:

  1. Open a 32-bit Command Prompt (C:\Windows\SysWow64\cmd.exe).
  2. Run VCVARS32.BAT
    • VS2010: "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\vcvars32.bat"
    • VS2008: "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"
  3. Set the target processor to x86 (set DETOURS_TARGET_PROCESSOR=X86).
  4. Build Detours using nmake.
Posted in Technology, Windows | Leave a comment

What Exactly Are ATL’s BEGIN_COM_MAP, END_COM_MAP, and COM_INTERFACE_ENTRY Macros?

There are many places where ATL’s COM_MAP macros are documented, but I haven’t seen it plainly stated what they actually mean.

Simply put, BEGIN_COM_MAP implements _InternalQueryInterface. COM_INTERFACE_ENTRY indicates that your class supports the specified interface. END_COM_MAP finishes the _InternalQueryInterface implementation.

Note: A QueryInterface implementation which calls this _InternalQueryInterface method must either be hand-coded, or supplied by CComObject, CComAggObject, etc.

For example:

class MyClass :
    public CComObjectRoot,
    public ISomeInterface
{
public:
    BEGIN_COM_MAP(MyClass)
        COM_INTERFACE_ENTRY(ISomeInterface)
    END_COM_MAP()
};

CComClass myInstance = new CComClass;

The COM_INTERFACE_ENTRY line indicates that MyClass implements ISomeInterface. If QueryInterface is called to requests an ISomeInterface pointer, the call will succeed. Without the COM_INTERFACE_ENTRY line, the QueryInterface call would fail.

Posted in C++, COM, Technology, Windows | Leave a comment

Skype 5.5 Cannot Display Asian Characters

After upgrading to Skype 5.5, I found that Japanese and Chinese characters showed as a series of boxes. I could type or paste them and they would be visible on the other end, but not on my end. Similarly, if the other person wrote Asian characters, they would not render correctly, like this:


A temporary fix is to change the IM font to Arial Unicode MS, which may have to be enabled from the control panel. Here are the steps:

  1. In the Skype menu, select Tools | Options, then click on “IM & SMS”, then “IM appearance”:


  2. Click on “Change font” to bring up the font dialog:


  3. If “Arial Unicode MS” is available, select it, click OK, then Save, and you’re done.

    If “Arial Unicode MS” is not available, then click “Show More Fonts” to bring up the Control Panel’s Font selector:


  4. Locate “Arial Unicode MS”, click on it to select it, then click on “Show” in the toolbar. Close the Fonts window (click the red X). You will have to close the Font dialog as well, then reopen it, in order for the Arial Unicode MS font to be displayed.

Posted in Technology | Leave a comment

Things That Suck: Ubuntu Unity

I just upgraded my virtual machine to Unity. All the negatives I’d read rang true. The interface really does seem like a poor copy of OS X, for tablets. Complaints are often dismissed with a curt suggestion to switch distributions. However, there is an inescapable truth:



If the #2 Google suggestion is “your product sucks”, you can take it as strong evidence that you’ve made a poor product development decision.

Personally, I’m rolling my virtual machine back to a prior snapshot.

Posted in Linux, Technology | Leave a comment

Virgin Mobile USA – No Data Connection (3G)

If you’ve been battling Virgin Mobile USA’s technical support drones and have been unable to get 3G data access, check that 3G data is enabled on your phone.

From the main screen:

  • Press the menu button
  • Select Settings
  • Select Wireless & Networks
  • Scroll to the bottom of the menu and select Mobile Networks
  • Make sure “Data Enabled” has a green check mark next to it

Virgin Mobile USA (i.e. Sprint) was unable to solve this after three phone calls over the course of a day. Their technical support script jumps straight into cellular network settings and battery removal.

Posted in Technology | Leave a comment

Activating a Virgin Mobile Phone in a Different Area Code – Vanilla Visa Payment Problems

As an experiment in semi-anonymity, I thought I would see if I could activate my Virgin Mobile Optimus V in a more desirable area code than my own. After a bit of research, I decided to buy a $50 Vanilla Visa prepaid debit card from Walgreens. They claim the card can be used for online purchases, but you’ll need to register the card and provide a zip code for verification. You can enter any zip code you like, and no personal information is required.

I was able to successfully create an account with Virgin Mobile in the desired area code. However, the payment was rejected. One possible reason is that Virgin Mobile may not be able to process a credit card with an expiration date so far in the future. The initial payment form used a text field for expiration year, so I could enter anything I wanted. When I revised my payment method, the web form only allowed selection up to, I believe, 2016. After I changed my payment method to a different, real credit card, the account was activated (though I still had problems with the phone being activated on the network).

So, first off, I’m pretty sure you could get the Virgin Mobile phone number in any area code you want, anyway, because the first step in their registration process asks your zip code. Billing is done at a later point in the process, with its own zip code field. Second, Vanilla Visa cards claim they can be used online, but since they have expiration dates far in the future, the website you want to buy from may not be set up to process them correctly. Basically, the entire process was interesting, but a waste of time.

At some point, it might be fun to try again using a pseudonym. When the online payment fails, one could call and attempt to resolve the payment over the phone. The effort involved would quickly exceed my interest in anonymity, but it might be a fun exercise.

Posted in Technology | Leave a comment

Source Control Use: Git, Mercurial, Bazaar, DARCS, Subversion, Team Foundation Server, CVS

What version control system is really most popular? Not in terms of getting mentioned on blogs, but in real-world terms of jobs?

Source: this HN comment, though I added CVS to the mix.

Posted in Technology | Leave a comment