socc3rpr0
12 years agoOccasional Contributor
Using a DLL with different procedure types
I have a question and not quite sure what the best way to do this would be. I have a DLL (32-bit) that uses GPIB to pass arguments and send low level commands. Now I want to use the same DLL to pass different procedure types using the 'DefineProc'. My question is do I always have to load the dll into memory as it shows in the help examples every time I define a different procedure? If not, what is the best way to do this?
Examples :
function MoveATS1Graph(Wsname, Row, Col)
{
var TabName = DLL["New"]("LPSTR", 100);
TabName.Text = Wsname;
//Define DLL
DLLFile = DLL["DefineDLL"]("ATS1GraphTool");
DLLFile["DefineProc"]("MoveGraph", vt_lpstr,
vt_int,
vt_int,
vt_void);
//Load The DLL Into Memory
Lib = DLL["Load"](ATS1DLLLocation);
Delay(500);
//Call Happens here
Lib["MoveGraph"](TabName, Row, Col);
}
function SelectActiveWindow(WBname)
{
var Workbook = DLL["New"]("LPSTR", 100);
Workbook.Text = WBname;
//Define DLL
DLLFile = DLL["DefineDLL"]("ATS1GraphTool");
DLLFile["DefineProc"]("SelectActiveWindow", vt_lpstr, vt_void);
//Load The DLL Into Memory
Lib = DLL["Load"](ATS1DLLLocation);
Delay(500);
//Call Happens here
Lib["SelectActiveWindow"](Workbook);
}
I guess my question really is how do I go about combining these two functions that only load the DLL once, but pass the different procedures types?