DllCallConv
DllCallConv DLLNumber, Call_Method
 
Parameters:

    DLLNumber = The DLLNumber
    Call_Method = The calling convention
Returns: NONE
 

      DllCallConv sets the calling convention of a given DLL. PlayBASIC supports three common types of function calling conventions. This is required as the function code inside machine code DLL's can be compiled with different compilers and different export settings, which can alter how the DLL function expects parameters to be passed in and how any return data comes back..

     Unfortunately Windows doesn't really provide us with a way of requesting the calling convention from a DLL, so you'll need to find that information yourself. For Windows system DLL's, these are well documented on 100's of Windows developer web sites. DLL's generally use either STDCALL or CDECL. So if one is crashing, then try then other. Please be aware though, there are other methods and different types of DLL's, we can't support everything!



Call_Method parameter values


           0 = STDCALL (Default)
           1 = CDECL
           2 = PASCAL




Call_Method 0 - STDCALL parameter passing method


      STDCALL calling convention passes the function parameters into the stack in reverse order. The called functions restores the stack upon return.



Call_Method 1 - CDECL parameter passing method


      CDECL calling convention passes the function parameters into the stack in reverse order. PlayBASIC cleans the parameters up after called function execution returns back to PlayBASIC.



Call_Method 2 - PASCAL parameter passing method


      The PASCAL calling convention passes parameters into the stack in call order. The called functions restores the stack upon return.





FACTS


      * Calling conventions determine the order in which parameters are passed to the routine through the system stack. They also affect the removal of parameters from the stack.

      * DllCallConv alters hows the paramter data is pushed to the stack when a function is called using any of the call methods such as CallDLL() CallDll#() or CallDll$()






Mini Tutorial:


     Not available.

 
Related Info: CallDLL | CallDll# | CallDll$ | GetDllCallConv | LinkDll | LoadDLL | NewAx :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com