mIRC Home    About    Download    Register    News    Help

Print Thread
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.
Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
With return type 2, parms sets $1- for the evaluation of data.


Saturn, QuakeNet staff
Joined: Jul 2013
Posts: 27
K
Ameglian cow
Offline
Ameglian cow
K
Joined: Jul 2013
Posts: 27
Can you be more specific please :p

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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?





#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
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
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

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Ah! Thank you!


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard