HI All--
I jave a html page that embeds the Visio Drawing Control as follows

runat="server" >

<PARAM NAME="NegotiateMenus" VALUE="1">
<PARAM NAME="NegotiateToolbars" VALUE="1">
<PARAM NAME="PageSizingBehavior" VALUE="1">
<PARAM NAME="Src" VALUE="D:\scratch\test1.vdx">


I have a java script in this HTML as follows

<SCRIPT type= "text/javascript">

function GetVisioOCX() {
return VisOCX;


I am opening this HTML using SWT Browser control. Once the document load is completed I want to execute this Java script and get the instance of Visio Drawing control.

I am using Browser.evaluate("return GetVisioOCX()") to invoke this java script.

I am getting following error org.eclipse.swt.SWTException: Return value not valid . I guess this means that return value cannot be converted to Java object and hence this error.

Is there any way I can get the instance of Drawing control by overriding some COM call or some tweaking in COM call?

I appreciate your time.