Returning a byte array from activex to javascript

Posted by vondip on Stack Overflow See other posts from Stack Overflow or by vondip
Published on 2009-08-03T19:58:27Z Indexed on 2010/06/02 21:04 UTC
Read the original article Hit count: 620

Filed under:
|
|

Hello all,

I've built a small activex control using c#. I've got a function that returns an array of bytes. From some reason when I try to consue the returned array in js I receive an undefined value. Why is this happenning? Is there anyway to solve it?

Here's a simple demonstration of my code:

Activex:

[ComVisible(true)]
    	public byte[] Close()
    	{
    		try
    		{
    			MessageBox.Show("called from activex Close");
    			return Stop();
    		}
    		catch (Exception e)
    		{
    			//ExceptionHandling.AppException(e);
    			throw e;
    		}
    	}

Javascript Call:

function CloseActiveX(){
var myRslt = document.OurActiveX.Close();
}

© Stack Overflow or respective owner

Related posts about c#

Related posts about JavaScript