Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8598517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:10:08+00:00 2026-06-12T01:10:08+00:00

I have a pretty complex class which extends System.Windows.Forms.UserControl . It’s written in C++/CLI

  • 0

I have a pretty complex class which extends System.Windows.Forms.UserControl. It’s written in C++/CLI with the /clr 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.

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.

Update: I followed this guide. 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 About page from the default C# Web App project, like so:

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        About
    </h2>
    <p>
        Put content here.
    </p>
    <object id="MyWinControl1" height="200" width="200" classid="http:MNeoConsole.dll#MNeoConsole.MNeoConsoleControl">
        <param name="Title" value="Locura loca" />
        <param name="Visible" value="true" />
    </object>
</asp:Content>

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.

Edit: 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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:10:10+00:00Added an answer on June 12, 2026 at 1:10 am

    runat="server" is not going to make your control run inside a browser. I think you have a fundamental misunderstanding of how ASP.NET works. Web controls don’t run inside the browser. They run on the server and produce HTML code that is sent to the browser, and may include various HTML controls and Javascript snippets.

    Any mechanism for client-side code other than HTML5 (Javascript) is going to require client-side support, i.e. the plugin you were trying to avoid. Of the possible plugins, the one that’s closest to WinForms and most portable is going to be Silverlight. That uses WPF, not WinForms, for user interface components. There is a WPF host for WinForms controls, but I don’t know if you can use that from inside Silverlight.

    Also, you need a bunch of special compile options in order to use C++/CLI with Silverlight. By default C++/CLI generates machine-specific native code which runs outside the browser sandbox. That’s going to be blocked by any user with a sane security configuration. You’re going to need to emit pure MSIL code and enable “Partial Trust”. Then you’re going to run into trouble with the native component you’re wrapping.

    There’s pretty much no advantage to doing this in a web browser. Just have the user download a WinForms application. You can use ClickOnce or another packaging technology to keep the application updated to the latest version on your site, but neither ASP.NET nor any of the browser technologies is going to play nicely with your control. Your other option is a rewrite, not of the wrapper, but of the whole OpenGL rendering layer, to use WebGL instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a pretty complex criteria, which I use to retrieve, sort and page
I have a pretty complex java class with over 60 small helper methods used
I have this scenario, which I think must be pretty common: class Parameter {
I have a class that represents a pretty complex object. The objects can be
I have a pretty complex object graph G with an object o1 in G
I have a pretty complex database schema and would like to know if there
I have a pretty complex linq statement I need to access for different methods.
I might have pretty basic question about regex. I have the following regex, which
I have built a PHP calendar system and have pretty much everything done but
I have a pretty complex chat application going on, and there are multiple chat

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.