example C++ http://www.oschina.net/code/snippet_115447_5588 ，my other blog web site