From WikiChip
Difference between revisions of "mirc/dynamic-link library"
(→Parameters) |
|||
Line 22: | Line 22: | ||
* '''<procname>''' - The name of the function/procedure you wish to call. | * '''<procname>''' - The name of the function/procedure you wish to call. | ||
* '''[data]''' - The optional parameters for the function/procedure. | * '''[data]''' - The optional parameters for the function/procedure. | ||
− | * '''<alias>''' - If you use $dllcall, it calls the function asynchronously, meaning that the code won't halt, $dllcall won't return a value. Instead, mIRC calls the specified <alias> when the function | + | * '''<alias>''' - If you use $dllcall, it calls the function asynchronously, meaning that the code won't halt, $dllcall won't return a value. Instead, mIRC calls the specified <alias> when the function finishes. |
= Creating a Dll = | = Creating a Dll = |
Revision as of 11:52, 21 July 2014
The /dll and $dll() features allow you to make calls to DLLs designed to work with mIRC. The main reason you would want to do this is that processing information in a DLL can be far faster than doing so in a script, so for intensive data processing a DLL would be more efficient.
Note: mIRC also supports calling COM objects, for calling non-standard DLLs.
Using a Dll
Synopsis
/dll <filename> <procname> [data]
/dll -u <filename>
$dll(<filename>, <procname>, [data])
$dllcall(<filename>, <alias>, <procname>, [data])
Switches
- -u - Unloads the dll
Parameters
- <filename> - The filename for the dll you wish to use.
- <procname> - The name of the function/procedure you wish to call.
- [data] - The optional parameters for the function/procedure.
- <alias> - If you use $dllcall, it calls the function asynchronously, meaning that the code won't halt, $dllcall won't return a value. Instead, mIRC calls the specified <alias> when the function finishes.
Creating a Dll
If you are making a dll, the exported function must have the following function prototype:
#include <windows.h>
int funcName(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause);
- mWnd - The handle of the main mIRC window.
- aWnd - The handle of the window in which the command is being issued, this might not be the currently active window if the command is being called by a remote script.
- mWnd - The handle the main mIRC window
- mWnd - The handle the main mIRC window
- mWnd - The handle the main mIRC window
Note: These functions must use the stdcall calling convention. (This is also the standard calling convention for all other Microsoft Win32 API functions.)