Note that there are some explanatory texts on larger screens.

plurals
  1. POReuse C++/CLI user control in .NET Web Application
    primarykey
    data
    text
    <p>I have a pretty complex class which extends <code>System.Windows.Forms.UserControl</code>. It's written in C++/CLI with the <code>/clr</code> switch, because it uses native C++ dlls. The class's main responsibility is acting as a wrapper for an unmanaged Direct3D9 dll which renders images over textures, zooms, pans, etc.</p> <p>Is there any way to reuse this class in a .NET web application? In other words, I want to get my user control to run inside a browser. The main uncertainties here are the access to native dlls, and the use of Direct3D. I'm setting up a small test to see if I can get this to work, but I'd like some input from someone else.</p> <p><strong>Update</strong>: I followed <a href="http://www.4guysfromrolla.com/articles/052604-1.aspx" rel="nofollow">this guide</a>. On the first try, I got an error saying that it could not load the control's dll or one of its dependencies. So, just for testing, I copied all the unmanaged dlls it uses to system32. Now I can load the page without errors, but I still cannot see the control. I placed the reference to it in the <code>About</code> page from the default C# Web App project, like so:</p> <pre><code>&lt;asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"&gt; &lt;/asp:Content&gt; &lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"&gt; &lt;h2&gt; About &lt;/h2&gt; &lt;p&gt; Put content here. &lt;/p&gt; &lt;object id="MyWinControl1" height="200" width="200" classid="http:MNeoConsole.dll#MNeoConsole.MNeoConsoleControl"&gt; &lt;param name="Title" value="Locura loca" /&gt; &lt;param name="Visible" value="true" /&gt; &lt;/object&gt; &lt;/asp:Content&gt; </code></pre> <p>I'll try the ActiveX approach now, but even if that works, I guess that would force my clients to use Internet Explorer, or install some plugin, wouldn't it? That would be really bothersome.</p> <p><strong>Edit</strong>: By now, I'm willing to try other approaches. For example, since my C++/CLI class is just a wrapper, I'm willing to write another wrapper in some other laguage. If I go that way, that language should be as friendly with web applications as possible.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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