mIRC Homepage
Posted By: Clint `parms` argument to mIRC DLL routine - 23/07/14 09:02 PM
Quote:

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


Putting a command (such as "/echo") in `data` and parameters (such as "-s hello") in `parms` does not work as expected.
In fact, I can find no situation under which the data in parms is actually used.

Someone able to enlighten me? smile

Code:
int __stdcall test(HWND mWnd, HWND aWnd, CHAR *data, char *parms, BOOL show, BOOL nopause)
{
    wcstombs(data, L"echo hello world", 900);
    wcstombs(parms, L"-s hi", 900);
    return 2;
}
Posted By: Sat Re: `parms` argument to mIRC DLL routine - 24/07/14 02:28 PM
With return type 2, parms sets $1- for the evaluation of data.
Posted By: kikuchi Re: `parms` argument to mIRC DLL routine - 24/07/14 07:10 PM
Can you be more specific please :p
Posted By: Wims Re: `parms` argument to mIRC DLL routine - 24/07/14 07:43 PM
Hello Saturn, what a clear answer.
I'm the one investigating on this, I was going to write a bug report before Clint posted here.

Because your answer isn't helping, I'll quote:
Quote:

2 means that it has filled the data variable with a command which it wants mIRC to perform, and has filled parms with the parameters to use, if any, when performing the command.
I'm not native speaker but this is saying to fill 'data' with a command (which is itself totally vague, should we give switches and parameters? We won't go over how filling data with "echo -a ok" works), and eventually we can fill 'parms' which is the parameters passed to the command in 'data'.
Code:
lstrcpy(data,"/echo");
lstrcpy(parms,"-a test"); 

lstrcpy(data,"/echo");
lstrcpy(parms," -a test"); 

lstrcpy(data,"/echo ");
lstrcpy(parms,"-a test"); 

lstrcpy(data,"/echo ");
lstrcpy(parms," -a test"); 

lstrcpy(data,"/echo -a");
lstrcpy(parms,"test"); 

lstrcpy(data,"/echo -a");
lstrcpy(parms," test"); 

lstrcpy(data,"/echo -a ");
lstrcpy(parms,"test"); 

lstrcpy(data,"/echo -a ");
lstrcpy(parms," test"); 


None of this works but your short answer is suggesting that:
Code:
lstrcpy(data,"/echo");
lstrcpy(parms,"-a test"); 
should work, as in: if you were to have a /echo override, "-a test" would be $1- inside that alias, this doesn't work for me.

Can you provide a short sample of code which will make use of 'parm' variable when returning 2?



Posted By: Sat Re: `parms` argument to mIRC DLL routine - 24/07/14 09:05 PM
Originally Posted By: Wims
Hello Saturn, what a clear answer. [..]

Because your answer isn't helping, [..]

Can you provide a short sample of code which will make use of 'parm'[sic] variable when returning 2?

Sure buddy, since you're asking so nicely:
Code:
  lstrcpy(parms, "hello, world!");
  lstrcpy(data, "/echo -s $1-");
  return 2;
Posted By: Clint Re: `parms` argument to mIRC DLL routine - 24/07/14 10:31 PM
Just wanted to post a more formal thank you here.
This code makes perfect sense smile I think the wording of the official documentation had me heading way down the wrong path!

Cheers,
Clint
Posted By: Wims Re: `parms` argument to mIRC DLL routine - 24/07/14 10:38 PM
Ah! Thank you!
© mIRC Discussion Forums