Pb With API and GetComputerName

BlitzMax Forums/BlitzMax Programming/Pb With API and GetComputerName

I think you are confused to what "Win32" means. It tells BMAX what the calling convention of the function is. Windows C/C++ uses what is called a STDCALL or PASCAL calling convention. For BMAX this means "Win32"

In BMAX I believe the default is what is termed "C" Calling convention. This is if you put nothing after your function prototype. It might be REGISTER but I dont know since its not documented. REGISTER is very fast but requires more code for compiler to implment so most Languages dont implment it as it is only usefuly if you have enough registers to pass the paramaters without using the stack.

Basically a calling convention is how the paramaters are managed on the stack and who, the caller or the callee, is responsible for cleaning it up when the function returns.

If you use the incorrect calling conventions you will crash. Maybe not right away but you are estentially mucking up the applications stack memory.

Good rule of thumb if it is windows API or DLL function call add "Win32" very few calls are "C" convention. Best place to look is the windows header files. but it does require you understand C.

Hope this helps understand what the "Win32" means.

Doug Stastny