mIRC Home    About    Download    Register    News    Help

Print Thread
`parms` argument to mIRC DLL routine #247185 23/07/14 09:02 PM
Joined: Jul 2014
Posts: 2
C
Clint Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
C
Joined: Jul 2014
Posts: 2
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;
}

Last edited by Clint; 23/07/14 09:13 PM.
Re: `parms` argument to mIRC DLL routine [Re: Clint] #247231 24/07/14 02:28 PM
Joined: Apr 2004
Posts: 862
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 862
With return type 2, parms sets $1- for the evaluation of data.


Saturn, QuakeNet staff
Re: `parms` argument to mIRC DLL routine [Re: Sat] #247245 24/07/14 07:10 PM
Joined: Jul 2013
Posts: 27
K
kikuchi Offline
Ameglian cow
Offline
Ameglian cow
K
Joined: Jul 2013
Posts: 27
Can you be more specific please :p

Re: `parms` argument to mIRC DLL routine [Re: Sat] #247246 24/07/14 07:43 PM
Joined: Jul 2006
Posts: 3,829
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,829
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?





Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: `parms` argument to mIRC DLL routine [Re: Wims] #247247 24/07/14 09:05 PM
Joined: Apr 2004
Posts: 862
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 862
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;


Saturn, QuakeNet staff
Re: `parms` argument to mIRC DLL routine [Re: Sat] #247248 24/07/14 10:31 PM
Joined: Jul 2014
Posts: 2
C
Clint Offline OP
Bowl of petunias
OP Offline
Bowl of petunias
C
Joined: Jul 2014
Posts: 2
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

Re: `parms` argument to mIRC DLL routine [Re: Sat] #247249 24/07/14 10:38 PM
Joined: Jul 2006
Posts: 3,829
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,829
Ah! Thank you!


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net