earriaga
12 years agoOccasional Contributor
function help error "An exception occurred: 0xC0000005"
Hey i just recently switched to TC 8.7 from Test 7.52 the scripts run great in 7, but this function is giving me some problem and don't know what could be wrong with it. Here is the function that sends a comman via GPIB
WriteToDevice(GPIBAdd, Command){ CMD = ["New"]("LPSTR", 100);
function WriteToDevice(GPIBAdd, Command)
{
var CMD = DLL["New"]("LPSTR", 100);
WriteToDevice(GPIBAdd, Command){ CMD = ["New"]("LPSTR", 100);
CMD.Text = Command;
//Define DLL
DLLFile = DLL["DefineDLL"]("VISA");
//Declare the DLL's function's Type and paramaters
DLLFile["DefineProc"]("VisaWriteOnly", vt_lpstr, vt_lpstr, vt_void);
//Load The DLL Into Memory
Lib = DLL["Load"](DLLLocation);
Delay(100);
//Call Happens here
Lib["VisaWriteOnly"](GPIBAdd, CMD);
}
It crahes at the end giving me the "An exception occurred: 0xC0000005; class: ; description: '' error I can't seem to figure out what could be wrong with it. It stops at the "Lib["VisaWriteOnly"](GPIBAdd, CMD);" It ran fine in TC 7.52, but after I converted the project file to TC 8.7 it doesn't run. Any clues what I am missing?