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 7083319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:09:48+00:00 2026-05-28T07:09:48+00:00

I’m trying to embed a Unity3D-ActiveX control into a WPF-Form by using a WinFormsHost-Control.

  • 0

I’m trying to embed a Unity3D-ActiveX control into a WPF-Form by using a WinFormsHost-Control.

Actually it works well when setting the path in the property window of VS, but when setting it in my code file it does not load anything. This is a known issue of the control but i thought i can simply copy the creation code of the forms-designer and initialize it manually.

When looking at the code of the initialization i noticed that there is no src property in the code, but the property is used in the property window. Setting the property manually does not work ( throws a error ).

After some test’s i decided to check the hole assembly for the src property, but the src property is never set and i can’t even find the string of the path.

Final thoughts

I noticed that there can be only one place where the src-path is located: The resource generated by the window forms designer, which is a object of the AxHost.State-type.

Question

How do i create a valid AxHost.State object to initialize the Unity3D-ActiveX control which should load a Unity3D-file specified by me?

  • 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-05-28T07:09:48+00:00Added an answer on May 28, 2026 at 7:09 am

    This is the solution which works but is a little bit slow( Note: You need to initialize the Control once in the Forms Designer and copy the OcxState object into the assembly resources ):

    // Create a ocx state object with the correct path
    _Unity = new AxUnityWebPlayerAXLib.AxUnityWebPlayer();
    ((System.ComponentModel.ISupportInitialize)(_Unity)).BeginInit();
    _Unity.OcxState = (AxHost.State)(Resources.Unity3DOcx);
    _Unity.TabIndex = 0;
    Controls.Add(_Unity);
    ((System.ComponentModel.ISupportInitialize)(_Unity)).EndInit();
    _Unity.src = _File;
    AxHost.State state = _Unity.OcxState;
    _Unity.Dispose();
    
    // Create the unity web player object
    _Unity = new AxUnityWebPlayerAXLib.AxUnityWebPlayer();
    ((System.ComponentModel.ISupportInitialize)(_Unity)).BeginInit();
    this.SuspendLayout();
    _Unity.Dock = DockStyle.Fill;
    _Unity.Name = "Unity";
    _Unity.OcxState = state;
    _Unity.TabIndex = 0;
    Controls.Add(_Unity);
    ((System.ComponentModel.ISupportInitialize)(_Unity)).EndInit();
    this.ResumeLayout(false);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.