From WikiChip
Difference between revisions of "mirc/commands/dll"
< mirc‎ | commands

(Created page with "The '''/dll command''' can be used to call an exported function from DLL with the specified parameters. == Prototype == The exported function must have the following ...")
(No difference)

Revision as of 20:44, 2 December 2013

The /dll command can be used to call an exported function from DLL with the specified parameters.

Prototype

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);

Note: These functions must use the stdcall calling convention. (This is also the standard calling convention for all other Microsoft Win32 API functions.)

Synopsis

/dll <libName.dll> <funcName> [data]
/dll -u <libName.dll>

Switches

  • -u - Unload the given loaded library.

Parameters

  • <libName.dll> - The name and path of the dynamic link library (DLL) file.
  • <funcName> - The name of the exported function to call
  • [data] - The data to pass to that function.

Example

/*
  gcc -c -O3 reverse.c
  gcc -shared --export-all-symbols -o reverse.dll -O3 reverse.o

  reverse.c:

  #include <windows.h>
  #include <string.h>
  
  int __attribute__((stdcall))
  reverse(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause)
  {
      char *l = *data ? data + strlen(data) - 1 : data;
      char *p = parms;
      while ((*p++ = *l--));
      strcpy(data, "/echo -s ");
      strcat(data+8, parms);
      return 2;
  }
*/
 
; /reverse This is an example!
; !elpmaxe na si sihT
Alias reverse {
  dll "reverse.dll" reverse $1-
}


Compatibility

Added: mIRC v5.6

Added On: 03/06/99

Note: Individual switches were not taken into consideration.

See also