"win32" and "@12"

BlitzMax Forums/BlitzMax Beginners Area/"win32" and "@12"

Bremer(Posted 2006) [#1]
I am having problems finding infomation in the docs about the use of "win32" and things like "@12" like shown in these two lines of code:

Function SetClassLong(hwnd:Int,nIndex:Int,dwNewWord:Int)="SetClassLongA@12"
Local wglSwapInterval(interval) "win32" = Byte Ptr(POINTER_wglSwapInterval)


Does anyone know if they are explained in the docs somewhere, which I just haven't found, or can explain their use.


CS_TBL(Posted 2006) [#2]
@12 is the combined amount of bytes your function-arguements are worth.

Since an int is 4 bytes, and you've 3 ints in that function, 4*3 makes 12.


Bremer(Posted 2006) [#3]
@12, sometimes people have @xx and sometimes not. Is there a rule for when to have it and when not to?


TartanTangerine (was Indiepath)(Posted 2006) [#4]
It depends on the language the dll was written in.


Bremer(Posted 2006) [#5]
Ok, but its this described somewhere, or should I be guessing which applies. Like if it doesn't work without, then try it with. Would be nice if someone had documented this. It could be thats its already there, I just haven't found it.


TartanTangerine (was Indiepath)(Posted 2006) [#6]
I thought I put the link, sorry : http://blitzbasic.com/sdkspecs/sdkspecs/userlibs_specs.txt


N(Posted 2006) [#7]
"win32" following a function (be it a pointer, extern'd function, or normal BMax funciton) designates that the function uses the stdcall calling convention.

This isn't documented in the BMax documentation (this should not be surprising, the docs are still far from useful in these situations).

As for @n, that seems to be the naming convention with the Visual C/C++ line of compilers, seeing as how this does not (seem to) occur with code compiled with GCC.

It's probably documented on MSDN.


Bremer(Posted 2006) [#8]
Thanks for the enlightenment, its highly appreciated.

Too bad that BRL aren't better at writing docs than they are. It would take away a lot of the fustrations that, at least I have sometimes, and make things a lot easier overall. Good thing that we have some of you clever people still around.