+5  A: 

Make sure that your C++ function is declared as __stdcall.

Pavel Minaev
My psychic-debugging said, "Calling convention"
Ian Boyd