Forum Discussion

zhe's avatar
zhe
Occasional Contributor
13 years ago

How to use .Net ref parameters in TestComplete?

Supposed there is a function:




public static int CanReceive(ref CanMsg msg);



How should I call it TestComplete?



I tried this:



var canMsg = dotNET.SomeLibs.CanMsg.zctor();

var result = dotNET.SomeLibs.CanReceive(canMsg);

Log.Message("Succeed!");



but it didn't work. I cannot see any messages in the log and it seems the test stopped at the 2nd line. What is the right to do it then? Thanks!!!



Regards,

Zhe

  • gid_216's avatar
    gid_216
    Frequent Contributor
    Hi Zhe,



    What is the status of the log after script execution? It is passed or failed or give some errors. If it is passed but you are not getting the expected log message, then check the dll, files added to CLRBridge, and if not getting any solution, try to debug it.



    Thanks,



    Deepak
  • zhe's avatar
    zhe
    Occasional Contributor
    Hi Deepak!



    Sorry I forgot to mention the test result:P There are nothing posted to the log, but the icon shows the funciton was successful. There is no exception shown anywhere but I am sure the function stopped at the second line.



    All other settings are correct (CLRBridge, platform...). By debugging you mean debug it in testcomplete using breakpoints?



    Regards,

    Zhe