0

Correct me If I am doing wrong:

We have an existing web-application in Flex-BlazeDS-Spring running on JBoss. We need to read a Dll from client machine so we have used ExternalInterface.call like below:

ExternalInterface.call("eval", 
                         "try { "Test" + 
                         " = new ActiveXObject('DllName.FunctioninDll'); }" +
                          "catch(e) { document.getElementById('" + dis+ 
                          "').SetLastError(e.message); } ");

With the above code I receive "Automation Server can't create Object" error with Mozilla "ActiveXObject is not defined".

Kindly suggest If there is any work around

Thanks

ketan
  • 19,129
  • 42
  • 60
  • 98
Suave Nti
  • 3,721
  • 11
  • 54
  • 78
  • I would bet that this is due to browser security settings. Turn off / reduce browser security and test again. – Sam DeHaan Apr 25 '12 at 18:58
  • Hi Sam, Thanks for it, but still It makes the application to run entirely using IE, IS there any another workaround for this Issue, Kindly suggest. – Suave Nti Apr 26 '12 at 18:51

1 Answers1

2

ActiveX is only available in Internet Explorer. You could try using the HTML object tag, but I'm not sure if it will work.

Gerhard Schlager
  • 3,155
  • 1
  • 31
  • 53
  • Hi Gerhard, Yea you are right..using ActiveX will force the users to run in I.E. (But, I still need to use this dll, damn I hate but cant skip using this dll). Is there any way that I can communicate to the local Dll in the client machines? Thank you once again – Suave Nti Apr 26 '12 at 18:49
  • 1
    Well, you could write a browser plugin. [NPAPI](https://developer.mozilla.org/en/Plugins) should work on all browsers except IE. You could take a look at [FireBreath](http://www.firebreath.org/) too. Maybe you could even use a Java applet and use JNI to call some methods of the DLL. However, since you require that your users are running Windows where some particular DLL must be available, why don't you make IE a requirement too? – Gerhard Schlager Apr 26 '12 at 20:41
  • +1 For Idea of using JNI, Yes have managed to wrap that JNI using VC++ and i have a wrapped dll with me,Dll works fine form Command mode. AM going to wrap that in a jar file ..But how can I load this jar file in a flex component on runtime ?? – Suave Nti Apr 27 '12 at 07:43
  • Take a look at [Using applet, object and embed Tags](http://docs.oracle.com/javase/7/docs/technotes/guides/plugin/developer_guide/using_tags.html) – Gerhard Schlager Apr 27 '12 at 07:55