Type error compiling examples on VS2012

Casting the divert layer argument for the DivertOpen function resolves
a type error in VS2012.