04-01-2009 12:14 PM
I am using a .Net assembly in the TestStand. All I am doing in the very fist pass/fail test is load the assembly, select a class, select a method to be called, check off the Create Object box, create a local variable of type object reference and put it in the object reference field. When I run it, the TestStand crashes. I put a breakpoint at the beginning of the step and added my object reference variable to the watch view. I see that it gets set to ".Net". Has anyone seen this behavior? The developer of the dll swears it must be the TestStand issue. How do I check in the TestStand what the constructor returned?
04-02-2009 02:08 PM
Lightbulb,
It looks like you posted a similar question that was answered here » http://forums.ni.com/ni/board/message?board.id=330&message.id=23654#M23654 .
04-02-2009 02:31 PM
Well, in reality, it hasn't been answered yet. One thing i figured out since i posted my questions was getting a ".NET" for an object reference is not an issue. I wrote a simple program in .Net myself and created my own .dll. I loaded the dll, checked off CreateObject, selected constructor Rect (int , int), passed params 5 and 6 to it, created a local variable of type Object Reference and put it in the Object Reference Field, then called method area().
I also get a ".NET for the Object Reference, but the function was called and it returned 30, which is 5 * 6 as expected.
The question that still remains is HOW DO I USE THE OBJECT REFERENCE FROM THIS STEP to use in the second step when i want to call the second method of the same class, subtractHeightFromWidth();
Here is the .Net code,
public class Rect {
public int width;
public int height;
public Rect()
{
return;
}
public Rect (int w, int h) {
width = w;
height = h;
}
public int area(){
return width * height;
}
public int subtractHeightFromWidth(){
int difference = width - height;
return difference ;
}
}