Forum Discussion

flenero's avatar
14 years ago

Not able to assign a string to a string property in a defined struct

Recently we just updated to TestComplete 8 (8.70) from TestComplete 7. Our Test Scripts define structures with string properties, when we try to assign a string to all the string properties TestComplete 8 is crashing with Catastrophic Failure error. NOTE that this is only happening when we run our test in TestComplete 8 (On testcomplete 7 the test scripts runs without any problem).



Please help on how to fix this.



Thanks



I was able to reproduce with the following code:



Function Test1()


{


  var MyStructID =
DLL["DefineType"]("MyStruct",


                                  vt_lpstr,
"First",


                                  vt_i4,
"Second",


                                  vt_i4,
"Third");


 


  var A1 =
DLL["New"]("MyStruct", 2);


 


   


 
A1["Item"](0)["First"] = "Hello"  // Catastrophic error


 
A1["Item"](0)["Second"] = 200;     


 
A1["Item"](0)["Third"] = 300;


 
A1["Item"](1)["First"] = 101;


 
A1["Item"](1)["Second"] = 201;


 
A1["Item"](1)["Third"] = 301;


}


 


Function Test1()


{


 


 var MyStructID =
DLL["DefineType"]("MyStruct",


                                  vt_lpstr,
"First",


                                  vt_i4,
"Second",


                                  vt_i4,
"Third");


 


  var A1 =
DLL["New"]("MyStruct", 2);


 


 


  // This produce
catastrophic error   


 
A1["Item"](0)["First"] =
DLL["New"]("LPSTR", 256);


 
A1["Item"](0)["First"]["Text"] =
"Hello"


 
A1["Item"](0)["Second"] = 200;     


 
A1["Item"](0)["Third"] = 300;


 
A1["Item"](1)["First"] = 101;


 
A1["Item"](1)["Second"] = 201;


 
A1["Item"](1)["Third"] = 301;


 
A1["Item"](2)["First"] = 102;


}

1 Reply

  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Felipe,


    I've registered an appropriate bug report in our DB, thanks for reporting it. Currently, we're working on its solution.


    Also, I've found your support case with the same problem in our DB. So, please continue working with Allen via e-mail. He'll provide you with all the results we'll get.



    Thanks.