VARTYPE
is 16 bits.
typedef unsigned short VARTYPE;
In order to kill the warning, you should use old style C cast or preferably C++ static_cast
.
vErg.vt = static_cast<VARTYPE>( lTargetType );
If you can, a better, but more complex, solution would be to refactor your code, passing VARTYPE
arguments instead of long
ones.