Hooking with JMP instruction and calling convention?-Collection of common programming errors

I’m hooking a 32-bit C++ function by overwriting its first 6 bytes with a JMP instruction.

When testing it sometimes (but not always) crashes if the functions don’t have the __stdcall calling convention. No crashes with __stdcall, so far.

This made me wonder if the JMP trick works only with certain calling conventions, or does it work with all of them?

I’m using VS2008 on Windows.