Cloned from http://code.google.com/p/np-activex/