From WikiChip
Difference between revisions of "mirc/dynamic-link library"
m (→Synopsis) |
|||
Line 1: | Line 1: | ||
− | + | 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. | |
− | The | ||
'''Note''': mIRC also supports calling {{mIRC|Component Object Model (COM)|COM}} objects, for calling non-standard DLLs. | '''Note''': mIRC also supports calling {{mIRC|Component Object Model (COM)|COM}} objects, for calling non-standard DLLs. | ||
− | + | = Using a Dll = | |
== Synopsis == | == Synopsis == | ||
− | + | /dll <filename> <procname> [data] | |
− | |||
− | |||
/dll -u <filename> | /dll -u <filename> | ||
− | + | ||
$dll(<filename>, <procname>, [data]) | $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. | * '''<filename>''' - The filename for the dll you wish to use. | ||
* '''<procname>''' - The name of the function/procedure you wish to call. | * '''<procname>''' - The name of the function/procedure you wish to call. | ||
Line 28: | Line 27: | ||
If you are making a dll, the exported function must have the following function prototype: | If you are making a dll, the exported function must have the following function prototype: | ||
+ | |||
<source lang="c">#include <windows.h> | <source lang="c">#include <windows.h> | ||
int funcName(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause);</source> | int funcName(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause);</source> |
Revision as of 07: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 finished.
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.)