Category Archive: C++

Jun 13 2011

Solved: The (Visual Studio) project file * has been moved, renamed or is not on your computer.

I renamed my Visual Studio 2010 (VS2010) Solution (.sln) and Project (.vcxproj) files today.  When I opened the Solution, it could not find the Project file, thinking it was still in the old location.  To solve this, I had to exit VS2010, delete the project’s .suo file, restart VS2010, open the Solution, and then re-add …

Continue reading »

Jun 02 2011

Display Unicode Characters on the Windows Console

Even in today’s mostly-Unicode world on Windows, the console (i.e. cmd.exe) still defaults to using OEM code pages (i.e. multibyte characters).  To set the console to Unicode mode, use the following code: #include <fcntl.h> #include <io.h> #include <stdio.h> int main(void) { _setmode(_fileno(stdout), _O_U16TEXT); wprintf(L”\x043a\x043e\x0448\x043a\x0430 \x65e5\x672c\x56fd\n”); return 0; } This information came from two great articles …

Continue reading »

Jun 02 2011

How to install VC++ update KB2455033

Head to the Visual C++ Team’s blog entry entitled “MS11-025 Visual C++ Update Issue“, scroll down to the section entitled “Visual Studio 2010 RTM with Windows SDK”, and follow the instructions there.  For completeness sake, here they are: If you have Visual Studio 2010 RTM and Windows SDK 7.1 installed on an x64 machine, then …

Continue reading »

Oct 06 2010

C++ Casting Operators

I often get confused about the different types of C++ casts: dynamic_cast can be used for “upcasting” or “downcasting” Upcasting:    A* pA = dynamic_cast<A*>(pB)  when B inherits from A Downcasting:  B* pB = dynamic_cast<B*>(pA)  when B inherits from A static_cast static_cast conversions are not as safe as dynamic_cast conversions, because static_cast does no run-time type …

Continue reading »

Sep 17 2010

Integrate the Windows SDK v7.1 with VS2010

Final Solution: I figured it out!  Open your project in VS2010, select the Project menu and choose Properties…, and click the dropdown next to Platform Toolset.  You can select between v100 (VS2010), v90 (VS2008), and Windows7.1SDK.  Select the 7.1 SDK and click OK.  Now you’re all set.  Note that you can use v90 to build apps …

Continue reading »