Monday, October 24, 2016

Cisco AnyConnect VPN and Remote Desktop Connection

Preface: today's post is not a particular one. As you can see, usual topic of the posts here is software development and non-obvious caveats you can meet along the way. This post is about "software taming": how to tweak the software written not by you.

Thursday, October 8, 2015

WPF Application.Current.FindResource() and uncaughtable exceptions

One more time to remind about The Old New Thing blog and trend to blame yourself first instead of Windows.
Today it was a trivial day with trivial task: find a resource by its name at a WPF app. What can be a problem, really? The plan was simple:
  1. Call Application.Current.FindResource()
  2. Wrap it into try...catch block as MSDN says we can meet ResourceReferenceKeyNotFoundException if the resource is absent or somehow missed in the app package.

Tuesday, May 21, 2013

Detective story: sendto() and 10014 WSAEFAULT error

Time to time I read The Old New Thing blog (authored by Raymond Chen, one of Microsoft old-timers). On his brilliant notes, he often describes pathetic customers who observe unexpected Windows API behavior and pretend this is Microsoft's bug. What a naive people, I would exclaim. And every time few paragraphs later Raymond Chen explains that root of such issue is the customer failure: neglection to documentation details, wrong assumptions etc. Ironically, I got pretty strange behavior at WinSock API recently. So what should be my first reaction? Indeed, I started from myself...

Tuesday, January 29, 2013

Socket Option: Multicast Interface

Disclaimer: this is a short description of a code snippet primarily for myself because I had failed to find corresponding details in MSDN as well as on Google about SocketOptionName.MulticastInterface parameter values. Feel free to use it if you're experiencing the same lack of luck.

Multicasts... You have to learn them right after generic sockets (aka unicasts) and massive spam-like broascasts. According to their nature, multicasts gather one-shot-to-many strength of broadcasting and can pass boundaries of nested networks like unicasts. The only weak side is knowledge "how to tune the socket".

Friday, January 4, 2013

How to launch Windows Phone 8 emulator on virtual machine

One of most remarkable events at 2012 was Windows roll-out: desktop Windows 8, tablet Windows RT and mobile Windows Phone 8 (here and after, WP8). Personally I'm a bit of Windows Phone evangelist and Windows Phone 8 launch, even delayed for few months, was a big interest for me, so I was eager to try it.
After WP8 SDK installation attempt, I learned that my Windows 7 workplace is obsolete. Almost no surprise here: if you need Win7 instead of old good WinXP to do WP7 development, why don't you need to upgrade your PC to Win8 before starting with WP8? Anyway, it was no reason (and no time, as usual) to re-settle my working environment from Win7 to Win8 just to try the new technology. The answer was stright-forward: let use virtual machine! So, the toolchain was obvious from the first glance: Win7 as a host, Win8 as a guest on virtual machine, then WP8 emulator to try the new SDK. After a long-enough time installing all the staff, the toolchain just failed on very last step. WP8 emulator been failed to launch, accompanied with incomprehensible error messages (very famous Microsoft-style, you can say).
Finally, if you're looking just for working solution, I can redirect you to one of proven ways to fix the problem: But if you're interested to take a deeper look, welcome to this note...

Friday, June 22, 2012

Plain C with RAII idiom

One day I was pushed into situation that I must write in pure old-scool plain C. Nova days, modern C++ is sky-rocketing with Standards Comittee initiatives but cross-platform development is another world. So you have to forget templates, Boost and even STL. But most painful for me as "clean code" adept was RAII absence: no wrapper classes, no auto-generated cleanup in scope epilog etc... But with some trade-off in mind, you can get RAII then!

Thursday, January 26, 2012

Live like you were web.config

Question: what is the most interesting ingredient of a web project’s code generated by Visual Studio? I can bet the first thing you named is “web.config” magic. Wonderful file which can auto-adjust its content according to debug/release build mode, pretty good example of XSLT power enhanced with some internals of Visual Studio... And one day you can quiz yourself with that question: how to do like web.config? How to introduce your own set of files and auto-adjust them according to debug/release/whatever? Let’s give a try...