I put this near the included wdls (not in an action or function):
var_nsave gam_dll;//variable that is not saved, but used on runtime


then this in the first part of the main() function (at the top of the script):

gam_dll=dll_open("gammaramp.dll");