mIRC Homepage

dll errors when clicking custom toolbar

Posted By: Darkmnm

dll errors when clicking custom toolbar - 23/09/20 01:12 PM

I downloaded a snippet for a custom toolbar and everything seems to work with the exception of one line which allows the popup to happen when clicking the arrow to select a server to connect to. I'm looking to see if anyone knows how to fix the error.

The error occurs due to the popups.dll on this line...
alias -l popup dll scripts\resources\dlls\popups.dll $1-

The error that I get is...
* /dll: insufficient parameters (line 14, Toolbar_Remote.ini)

dialog tb {
title "tb"
size -1 -1 514 8
option dbu
list 1, 2 -1 1001 16, size

;heres where we get the icons from
alias -l icons return $+(scripts\resources\icons\,$1-)

;this is for popup.dll is just edit the filenames
alias -l popup dll scripts\resources\dlls\popups.dll $1-
alias -l popmenu {
tokenize 32 $dll(scripts\resources\dlls\popups.dll,Popup,$1-)
if ($isid) { return $1- }
if ($4- != did not select a menu item) { $4- }

;heres where we make the toolbar!
on *:dialog:tb:init:0:{
;basic needs for MDX to work
;making the toolbar!
mdx SetControlMDX $dname 1 ToolBar list arrows flat wrap nodivider > $bars
mdx SetDialog $dname style
mdx SetBorderStyle 1
;here is where we start to make the icons
;size of icons id dbu I beleive
did -i $dname 1 1 bmpsize 32 32
;these are the icons I use
did -i $dname 1 1 setimage icon large $icon7
did -i $dname 1 1 setimage icon large $icon33
did -i $dname 1 1 setimage icon large $icon3
did -i $dname 1 1 setimage icon large $icon10
did -i $dname 1 1 setimage icon large $icon9
did -i $dname 1 1 setimage icon large $icon6
did -i $dname 1 1 setimage icon large $icon32
did -i $dname 1 1 setimage icon large $icon31
;heres where we make text and tool tips!
;please note: $chr(9) is what sets the text and the tool tips apart
;also notice the +v it makes the a drop down arrow you'll learn more about that later
;the numbers? they are the number of the icon the numbers are the same as you list the icons above wink
did -a $dname 1 +v 1 server $chr(9) connect to server
did -a $dname 1 +a 1 -
did -a $dname 1 +a 2 $chr(9) Mirc Options
did -a $dname 1 +a 3 $chr(9) Acuto ID
did -a $dname 1 +a 4 $chr(9) Auto Join
did -a $dname 1 +a 5 $chr(9) Sounds
did -a $dname 1 +a 1 -
did -a $dname 1 +a 6 $chr(9) Away
did -a $dname 1 +a 7 $chr(9) Away System
did -a $dname 1 +a 8 $chr(9) Auto Join
;how we dock this tool bar
rebar Dock $dialog($dname).hwnd > top
;remember that arrow?
;well that arrow when clicked gives a dclick event wink
on *:dialog:tb:dclick:1: { popup }

;this is a popup!
;this is easy
;eg text $cr command
alias popup {
popup New tb 16 16
popup SetMetrics tb iconpad 0 0 contentpad 0 0 spacing 0 0
popup AddItem tb end + 1 1 new connection $cr server -m
popup AddItem tb end +
popup AddItem tb end + 2 2 razorville $cr server irc.razorville.co.uk
popup AddItem tb end + 3 3 undernet $cr server irc.undernet.org
popup AddItem tb end + 4 4 elite-scriptaz $cr server irc.elite-scriptaz.net
popup AddItem tb end + 5 5 rizon $cr server irc.rizon.net
popup AddItem tb end + 6 6 creative $cr server irc.creativeirc.net
popup AddItem tb end +
popup AddItem tb end + 7 7 disconnect $cr quit $read(docs\quits.txt)
popmenu tb $mouse.dx $mouse.dy
;easy for scripters
;commands for the click on the icons
;note this isn't done ;x
on *:dialog:tb:sclick:1:{
if ($did($dname,1).sel == 2) {
if ($server) { .quit Off to do life! }
if (!$server) { .server }
elseif ($did($dname,1).sel == 4) { /sendkeys % $+ o }
elseif ($did($dname,1).sel == 5) { _autos }
elseif ($did($dname,1).sel == 6) { _autos }
elseif ($did($dname,1).sel == 7) { _eso }
elseif ($did($dname,1).sel == 8) { tbd }
elseif ($did($dname,1).sel == 10) { /sendkeys % $+ c }
elseif ($did($dname,1).sel == 11) { /sendkeys % $+ s }
Posted By: maroon

Re: dll errors when clicking custom toolbar - 23/09/20 05:52 PM

The error message tells you that have insufficient parameters, so that's what happens. Add a debug line right above it to see what's being sent to it:

echo -s debug: $nopath($script) $scriptline (1) $1 (2-) $2-

Using /dll is actually a little more forgiving than $dll is. When there's a dllproc which doesn't need any parameters, the $dll form still requires you send the empty parm like $dll(filename.dll,procname,)

However the /dll method doesn't object to it.
//dll filename.dll RequiredProcname OptionalData

However, the fact that /dll gives this error means that, not only are you missing the 'data' parm, but you're also missing the procname too. It looks like this syntax is expecting the procname to be part of the $1- but I can't find this alias being called anywhere that passes any parms at all to it.

Also, I see you have a local and global alias both named the same thing. This can also cause confusion, since the script itself can see the "alias -l aliasname", but the channel editbox or other scripts can only see the "alias aliasname"
Posted By: Darkmnm

Re: dll errors when clicking custom toolbar - 23/09/20 08:28 PM

Thank you maroon for your reply. I appreciate you explaining why and how the error occurred but I downloaded this snippet from online and was hoping someone could chime in with a fix or work around as I have been out of scripting for a very long time and in real life don't have the time anymore to dive into it again.

Can anyone assist?
Posted By: maroon

Re: dll errors when clicking custom toolbar - 24/09/20 01:48 AM

You'd need to hope there's someone out there who uses this dll, which I've never heard of. A dll is like a collection of 1-or-more identifiers or commands wrapped up inside an external binary. Hopefully you have some documentation telling you which procedure names are inside the dll, and hopefully the docs tell you the syntax of how to use them.

The procedures inside the dll are similar to alias names inside the dll which can do things a scripted alias can't do by itself, and the procedures need to be called in their exact case-sensitive name. You can call them like a command, as in:

/dll filename.dll procedurename this is the $1- for the procedure
//echo -a $dll(filename.dll,procedurename,this is the $1- for the procedure)

We'll have a hard time helping you when your problem is that, not only are you not feeding the $1- to the dll's procedure, you're not even passing the name of the procedure either.

edit: if you have trouble figuring out that dll, perhaps better luck with spopup.dll http://www.xise.nl/mirc/
© 2021 mIRC Discussion Forums