Forum Discussion

earriaga's avatar
earriaga
Occasional Contributor
12 years ago

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




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?

1 Reply

  • AlexeyK's avatar
    AlexeyK
    SmartBear Alumni (Retired)

    Hi Ed,


    I'd suggest that you download a trial version of TestComplete 9 and check your script with it. As far as I know, guys made some changes to the DLL Access subsystem and to the subsystem that provides information about exported DLL functions, so, perhaps, the problem has gone.


    If the problem persists, I'd suggest that you contact our Support Team.

    Please describe the problem and include the function's declaration (that is, the way the function is declared in the source code), for instance, something like --


    void VisaWriteOnly(LPSTR param1, LPSTR param2);


    This will help our guys to reproduce the problem.