c++ - When using PInvoke, why use __stdcall? -
i have been using pinvoke let c# application call c++ functions wrote.
now, keep hearing everywhere , beyond need define externally accessible functions __stdcall
convention. question is: why?
so far, have accidentally ignored advice, , works charm. when add __stdcall
functions, keeps working in same way (or @ least seems so).
this article says __stdcall
used win32 bit functions, compiling against x64 platform. mean shouldn't using __stdcall
after or mean missing out on else?
and please, use simple english when responding. ;-) lines (quoted article linked):
the callee cleans stack, compiler makes vararg functions __cdecl.
make brain feel there's tumbleweed blowing through it.
there 1 calling convention on x64 , not matter calling convention specify. ignored on x64.
on x86 important make sure calling conventions match on both sides of interface. if ever anticipate running code on x86 prudent right now.
Comments
Post a Comment