Note that there are some explanatory texts on larger screens.

plurals
  1. POActiveX works on localhost, doesn't work on external server
    text
    copied!<p><strong>Edit2:</strong> For users that are having the same problem, I have managed to solve it using <a href="http://www.codeproject.com/KB/cs/C__Deployment.aspx?msg=3244347" rel="nofollow">this page</a>. Good luck!</p> <p><strong>Edit:</strong> Apperently my problem is that I need to install the ActiveX component on the client computer. What is the right way to do this?</p> <p>I wrote a small ActiveX component in C# which searches for removable drives like USB flash drives. I have followed the steps <a href="http://dotnetslackers.com/articles/csharp/WritingAnActiveXControlInCSharp.aspx" rel="nofollow">here</a>, in short I wrote some code and did: <code>regasm AClass.dll /tlb /codebase</code></p> <p>I wrote the ActiveX component because it needs to get executed on an external server. So I made a small webpage which uses the ActiveX. When I use a localhost the code gets executed and my USB key gets detected. It even works from inside an ASP.NET page which is the final goal.</p> <p>However, when accessing the page from an external server, the code doesn't get executed. I placed javascript alerts before and after loading the ActiveX component. The alert after loading the ActiveX doesn't even fire.</p> <p>The webpage uses this code:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script language="javascript"&gt; alert("Loading ActiveX"); var x = new ActiveXObject("ANamespace.AClass"); alert(x.GetDrives()); alert("Done"); &lt;/script&gt; &lt;/head&gt; &lt;body&gt;&lt;/body&gt; &lt;/html&gt; </code></pre> <p>I can post the C# ActiveX code although I think it isn't needed, it just tries to find removable diskdrives, and it did work fine on my localhost.</p> <p>Note, this is actually my first time working with ActiveX. Thanks in advance!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload