tags:

views:

78

answers:

0

Noticed this strange behaviour with an ocx component. The component is normally included in the html-page with an object-tag. Using IE 7.
Then it is called like so:

alert(foo.getStatus());

This alerts for example "2"

But when I call it like this, nothing is returned:

s = foo.getStatus();
alert("> "+s);

This alerts "> "

alert("> "+foo.getStatus());

This also doesn't work, alerts "> "

alert(s); // does work
if (s==2) {alert("foo");} // doesn't work

Here the return type for getStatus() is long (using .net/C#). When I change the return type to short all examples work.

Are there some limitations to the return types or some bug in IE, or is there a workaround for this? Now I can't save the method return value in a variable.