daedalusd:
Yes and no. For the windows platform this is the only difference in the calling convention. It also changes the way the function name is scrambled for exportation, but AngelScript doesn't bother about that.
Perhaps I jumped the gun a bit when I said __stdcall and __thiscall are the same except for the object pointer. This is true for the MSVC compiler, but for g++ based compilers this is not true. I don't know how it is for other compilers. The various compilers are not in agreement on how to implement object method calls. And method pointers are even more complicated. But you can be pretty sure that __stdcall will work as you implemented it, as most compilers that work on the windows system can call Microsoft library functions. For other platforms like Linux I'm not sure that __stdcall even exists.
Please, do send me the code changes. It will be much faster for me to include it in the library that way (and I'll add your name to the contributions list :) You can send me the changed files, and I'll use WinMerge to find the differences.
Magmai Kai Holmlor:
Actually, the bstr type we are talking about is not the COM bstr, it is a simple byte string that I designed for AngelScript. Though it takes heavy influence from the COM bstr in that it stores the length just before the actual data, and also guarantees a null termination after the string data. (perhaps it was an unfortunate choice of name)
The correct choice in this case would be MessageBoxA().
__stdcall calling conventions on global functions.
MSDN says:
Quote:Keyword Stack Parameter passing cleanup__cdecl Caller Pushes parameters on the stack, in reverse order (right to left) __stdcall Callee Pushes parameters on the stack, in reverse order (right to left) __fastcall Callee Stored in registers, then pushed on stack thiscall Callee Pushed on stack; this pointer stored in ECX(not a keyword)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement