There are complete working samples on MSDN.....