Konda.eu

Monthly Archives: June 2015

No comments

Internet Explorer - Touch Actions Not Working

During recent development of a JavaScript based Windows Store App I came across an interesting problem. On the development PC (it isn't touch ready) everything worked perfectly until the app was installed on the test tablet. After the famous line:

It works on my machine

said a couple of times and a long night of searching what might be the solution, I came across this neat CSS snippet:

html { 
    -ms-touch-action: none; /* -ms- was dropped with IE11 */
}

The cause

After an examination of CSS touch-event, Internet Explorer behaves by the standard so we really can't blame it for this one (just this one). Automatic value (auto) lets user agent (the browser) decide what actions are most appropriate for specific elements, therefore taking control of touch events for better browsing experience. By setting the value to none, the browser lets us do whatever we want with it.

zoom
No comments

C++ - The value of ESP was not properly saved across a function call

Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.  This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.

Another run time error that is almost impossible to quickly identify and debug. It usually occurs when libraries are involved and use different calling conventions e.g. _stdcall instead of _cdecl or other. But sometimes compiler misses a thing or two and compiles something that it shouldn't, after all, compiler only need to know how many bits and bytes to move and what do to with them to translate your program to an executable or a library. Sometimes it lets you do stupid things...

Continue reading

zoom
No comments

C++ - everything to know about Time and Timers

For years, since 1983 when C++ was first released, developers were stuck with C time library, packed in ctime header file. It contains a couple of functions and precision up to a second sometimes just isn't enough. For everything else clock() should be used or OS (Operating System) provided function, which really breaks code portability. In C++11 things got much better, with Chrono module.

Continue reading