mIRC Home    About    Download    Register    News    Help

Print Thread
#129500 06/09/05 06:55 PM
Joined: Sep 2005
Posts: 116
I
Vogon poet
OP Offline
Vogon poet
I
Joined: Sep 2005
Posts: 116
as a future i would like tobe able to add more parameters to 1 dll call

like add the 1st parameter to char* data and add folorwing parameters to char *parms

this would still make old 1 parameter dll's work whi the new system only new dll's wont work on older mirc versions laugh (unless they still only use 1 parm)

#129501 08/09/05 08:49 PM
Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
Why not just convert each parameter in to different c++ types as well? smile (Just kidding)

You could always write your own class or functions to process strings from mirc, use the 'String' class to start with.... Then wrap the dll call with another identifer...

Code:
#MultiparameterDLL on
; Use a colon to separate dll parameters
alias dllparm { tokenize 58 $1- | return $1- }
alias test { echo -a $dll(file.dll, Function, $dllparm(Test, this, out)) }
#MultiparameterDLL end


Naquada


NaquadaBomb
www.mirc-dll.com
#129502 08/09/05 09:38 PM
Joined: Sep 2004
Posts: 200
I
Fjord artisan
Offline
Fjord artisan
I
Joined: Sep 2004
Posts: 200
I woud say use a regex to find all the data, i.e use
command, -flag "param1" -blah "param2", and use \\ for a backslash, and \" for a quote.

#129503 08/09/05 09:41 PM
Joined: Sep 2005
Posts: 116
I
Vogon poet
OP Offline
Vogon poet
I
Joined: Sep 2005
Posts: 116
Quote:
Why not just convert each parameter in to different c++ types as well? smile (Just kidding)

You could always write your own class or functions to process strings from mirc, use the 'String' class to start with.... Then wrap the dll call with another identifer...

Code:
#MultiparameterDLL on
; Use a colon to separate dll parameters
alias dllparm { tokenize 58 $1- | return $1- }
alias test { echo -a $dll(file.dll, Function, $dllparm(Test, this, out)) }
#MultiparameterDLL end


Naquada
it seems nice can u expali a litlem ore of wut u mean ?

#129504 08/09/05 10:10 PM
Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
Not really... That being said, You need to take a good C++ course that can teach you classes and inheritence. I don't even understand the concepts that well myself. I'm an electrical technician, not a programmer, and those two subject matters are not lite readings...


NaquadaBomb
www.mirc-dll.com
#129505 09/09/05 01:53 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Lol. Yeah, classes are "fun" to learn.


Invision Support
#Invision on irc.irchighway.net
#129506 09/09/05 04:45 PM
Joined: Sep 2005
Posts: 116
I
Vogon poet
OP Offline
Vogon poet
I
Joined: Sep 2005
Posts: 116
LoL im aos an electrotechican

and indeed classes are a pain in the ass ot learn i tryed a few toturals since they are used a lot but everythime i fial lol

i gues i stick to my old methed whit 3 seperate calls laugh
Code:
int __declspec(dllexport) FAR PASCAL ChannelNummer(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause){
	int intdata;
	intdata = evalint(data);
	if(intdata < maxchannels) channelpointer = intdata;
	else MessageBox(NULL,va("Error: channelpointer is bigger then maxchannels (%d>=%d)",intdata,maxchannels),PROGNAME,MB_OK);
	return 1;
}
int __declspec(dllexport) FAR PASCAL ChannelName(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause){
	strcpy(ircchannel[channelpointer].name,data);
	ircchannel[channelpointer].name[CHANLEN] = '\0';
	return 1;
}

int __declspec(dllexport) FAR PASCAL ChannelFlags(HWND mWnd, HWND aWnd, char *data, char *parms, BOOL show, BOOL nopause){
	strcpy(ircchannel[channelpointer].flags,data);
	ircchannel[channelpointer].flags[FLAGCOUNT] = '\0';
	return 1;
}
to fill channel[nummer].flags and .name lol
first do a dll call to set the nummer then a call to set the name and thne a call to set the flags laugh

#129507 21/09/05 11:27 AM
Joined: Jan 2003
Posts: 249
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Jan 2003
Posts: 249
I can provide you with my custom string library that handles tokens if you want to. It fully supports (it's not yet complete, I only completed what I needed for the moment) $*toks like mIRC's way of doing it. You can also us it to compare arguments like :

Code:
if ( input.gettok( 2, " " ) == "blah" ) {
 ...
}


It is what I use in creating my DLLs and was built as a learning part of making my own "string" library which I added token support afterwards.


Link Copied to Clipboard