We use a dll call in a GuiXT script and have found the following problem. When we were passing in the "1" to select which com port the scale is connected to, the switch (portnum) statement in the C++ program would not set the "CommNum" to any value. You can see I am passing a numeric parameter for the com port selection, which worked when I used a VB program to call GetComWgt.dll. Is there any reason why the script will not pass the "1" as a numeric?

GuiXT has no integer, float, double, date,... typed variables; it only has strings. So it passes the value "1" as a zero-terminated string to the dll. For given dll functions, this often requires a wrapper around the call that converts the string into a suitable format.