Posted on 2002-06-13
Now on to learning about DLLs. Seems easy enough..
mIRC can use a DLL with this calling convention:
int __stdcall procname(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause)
mWnd is the handle to the main mIRC window.
aWnd is 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.
data is the information that you wish to send to the DLL. On return, the DLL can fill this variable with the command it wants mIRC to perform if any.
parms is filled by the DLL on return with parameters that it wants mIRC to use when performing the command that it returns in the data variable.
( I'm not going to edit the boolean parameters )
I wrote this (conversion). I want to assign a value to the 2 PChar parameters before returning a value of 2.
function TestString(mWnd,aWnd: THandle; data, parms: PChar; show,nopause: Boolean): integer; Stdcall;
data := '/msg $me ';
parms := 'Successful test!';
Result := 2;
It seems like I am assigning values to a local copy of the PChars as the caller is using the original default values after the call. I need to plug the new Char-Strings into the memory slot where the original PChar values are (overwrite). Am I close?