How do you know it's setting the variable? The mIRC help for $dllcall says the parameters are this
Quote:

$dllcall(filename, alias, procname, data)


Are you sure you're calling it correctly?