The scripting language supports direct invocation of the C-language API functions provided by the operating system to ensure greater flexibility
Currently, only C-language functions with function calling conventions of __stdcall are supported
The C language variable and the L scripting language object is not a one by one corresponding relationship, so when you call a C function, you cannot directly pass the L script language object as a parameter, but you can make the appropriate conversion
The following is a call to Windows system Kernel32.dll in the OUTPUTDEBUGSTRINGW function and
An example of calling the MessageBoxW function in User32.dll
and encapsulates it as a global function of the L scripting language
#scplib
Definition: String, Kernel32,c:\windows\system32\kernel32.dll
Definition: C function, Myoutputdebugstringw,kernel32,outputdebugstringw, none, c wide character pointer
Definitions: Functions, output debugging information, debug messages
Start: function, output debugging information
definition:
C wide character pointer, parameter 1, debug message
Call: C function, Myoutputdebugstringw, none, Parameter 1
End: function, output debug information
Register: function, output debug information
#scplib
Definition: String, User32,c:\windows\system32\user32.dll
Definition: c function, Mymessageboxw,user32,messageboxw,c Integer, handle, C wide character pointer, c wide character pointer, c unsigned integer
Definitions: Functions, pop-up windows, titles, content
Start: Functions, pop-up windows
Definition: Handle, parameter 1,0
Definition: C wide character pointer, parameter 2, content
Definition: C wide character pointer, parameter 3, caption
Definition: c unsigned integer, parameter 4,0
Definition: C integer, return value, 0
Call: C function, Mymessageboxw, return value, Parameter 1, parameter 2, parameter 3, parameter 4
End: function, pop-up window
Registration: Functions, pop-up windows
#scp
Import: library, H:\SCRIPTENGINE\SCRIPTS\KERNEL32LIB.SCP
Import: library, H:\SCRIPTENGINE\SCRIPTS\USER32LIB.SCP
Definition: String, debug information, "Hellodebugmessage"
Definition: String, dbgstring, "ABCD"
Output Debug Information: Debug information
Output Debug Information: dbgstring
Definition: string, string1, hello Programmer
Definition: String, string2, title
Pop-up window: string2,string1
L scripting language invoke operating system API