std::async, and copies – gotcha!

Disclaimer: I love C++11! It’s the best thing that happened to C++ since I’m using it (mid-90’s). I’ve been hoping for lambda‘s in C++ since I discovered and started using Lisp. Elisions and move semantics – together with unique and shared pointers – pretty much free you from thinking about memory management! It’s just amazing! Check out “Going Native” talks on YouTube, incl. amazing talks by the likes of Stroustrup, Sutter, Lavavej, et al.

If you don’t want to read my rant, here’s the point – function objects are objects – they can get copied, unless you specify otherwise, so beware that you’re working on a copy, or pass std::ref.

Continue reading

Windows XP Customization

Most of the following customizations work on Win2K also, but I’m not anymore sure which do and which don’t.

Enable-Disable Task Manager

Key: Software\ Microsoft\ Windows\ CurrentVersion\ Policies\ System
Name: DisableTaskMgr
Value: 1 = Enable this key, that is DISABLE Task Manager
Value: 0 = Disable this key, that is Don’t Disable = ENABLE Task Manager

Customization of Start Menu

Continue reading

Sending e-mail using pure WinSock

I’ve spend quite a bit of time these days searching for a simple way to send email from C++.

There sure is a lot of stuff on this on the Net, but there was one trouble – the program I’m writting is an NT service. Thus, all those MAPI-based solutions didn’t work for me (there are simply too many small things you have to take care of, that disable simple installation of software).

So, I just looked up “SMTP” on Wikipedia, and believe it or not, it was enough. I just wrote the whole thing as a pure plain-text communication with SMTP server, at it worked at first shot, haha!

Continue reading

Tips on ICS on Windows XP

If you’re not in mood to read all I have to say, and want just simple plain tips, feel free to skip to the end of post. 🙂

About a month ago, I was trying to set-up ICS (Internet Connection Sharing) between my computer and my wife’s laptop.

There sure are many guides on the Net about how to set all up, and what to do or not to do. Unfortunately, many of them are contradicting each other (or sometimes even themselves, haha!).

All I needed to set up was the ICS itself, no disk/file/printer sharing. Thus, most of stuff that follows won’t be useful for anyone who needs also any other kind of sharing, except of the connection to the internet. To be precise, switching off all other kinds of sharing helped me to achieve much higher stability of service.

Continue reading