Posts in Category: Visual Studio

Why I am a resolution junky 

I have been coding for many years now (scarily > 15 years), I have always aimed to get higher and higher resolution screens or alternatively multiple screens. Sadly as mentioned in an earlier blog post the computer I am using at the moment is a desktop replacement laptop with a dying screen so I purchased a 27" 2560x1440, not quite my laptops 3200x1800 but still pretty reasonable and great for late night coding! The above is an example of me geeking out, library coding and demo/test rig coding in parallel

Posted by Stuart James Monday, October 20, 2014 10:37:00 PM Categories: C++ Microsoft Programming Tech Visual Studio

SAFESEH and Visual Studio 

Many of us dont hugely enjoy recompiling libaries. I for one who only use 3 large and a handful of small, causing me to cringe at the idea of recompiling to include a new feature or worse a new platform. 

So when I hit:

error LNK2026: module unsafe for SAFESEH image.

So after looking around for a solution I found there is just a simple switch you can turn off to allow an old library to be used

SAFESEH Visual Studio

Hidden in Linker --> Advanced -> Image Has Safe Exception Handlers you can set this to No and recompile and your code work again.

Posted by Stuart James Thursday, October 31, 2013 2:08:00 PM Categories: C++ HowTo Visual Studio

C++ + Visual Studio 2012 (VS2012) + Win8 , converting projects up some conflicts I found 

Having loved the ability to compile VS2010 projects inside the VS2012 shell as a way of delaying the update, I thought it was time to stop delaying ( 1 Year late ).

std::cout << "Minimum value for int: " << std::numeric_limits<int>::min() << std::endl;
std::cout << "Maximum value for int: " << std::numeric_limits<int>::max() << std::endl;

Generates error:

error C2059: syntax error : '::' [path]\source.cpp

There is a good chance if you have these lines and are including the windows header you will hit an error. The Windows team put in a solution to the #define min conflict in <minwindef.h>.

So instead of

#include <windows.h>

You use a #define to avoid this

#define NOMINMAX
#include <windows.h>

Another issue I found was with an annoying char define, again from the Windows team in <rpcndr.h>.

#define small char

This one doesn’t have the ability to comment out for so if you have a small function with something like:

AnObj small = large.resize(val);

Generates error:

error C2628:'AnObj' followed by 'char' is illegal (did you forget a ';'?) [path]\source.cpp

You will have to suffer and change the name, in some ways it teaches you (me) for not being very specific, still annoying though. Hopefully this is all the conversion errors I’ll hit.

Posted by Stuart James Sunday, May 12, 2013 4:13:00 PM Categories: API C++ Visual Studio Windows8
Stuart James