.Calling Conventions

Category: DLLs

Date: 03-28-2012

Return to Index


 
'Usually, a PowerBASIC programmer uses the StdCall procedure calling convention.
'StdCall is required by Windows API and is used by most languages when creating
'DLLs.
 
'For those cases where a programmer needs to access DLL's written with different
'calling conventions, the PowerBASIC Declare statement additionally supports both
'BDECL and CDECL calling conventions:
 
BDECL  Basic/Pascal    left-to-right
CDECL  C               right-to-left
SDECL  StdCall MS      right-to-left     'default
 
'Comments:
'PowerBASIC BDECL/CDECL/SDECL functions automatically clean up the stack.
 
'With CDECL:
' - PowerBASIC auto-creates a lower case _Alias (if imported or exported)
' - Trailing parameters can be optionals by using [] brackets (pass # params)
 
'gbs_00322
'Date: 03-10-2012


created by gbSnippets
http://www.garybeene.com/sw/gbsnippets.htm