I am trying to embed a Unity3D-ActiveX control in a WPF form using WinFormsHost-Control.
Actually, this works well when setting the path in the VS properties window, but when you install it in my code file, it doesn't load anything. This is a known management issue, but I thought I could just copy the code to create the form designer and initialize it manually.
When I looked at the initialization code, I noticed that there is no property in the code src, but the property is used in the properties window. Setting the property manually does not work (it gives an error message).
After some testing, I decided to check the hole assembly for the property src, but the property is srcnever set, and I can’t even find the path string.
Final thoughts
I noticed that there can only be one place where the src path is located: a resource created by the window form constructor, which is an object of the AxHost.State type.
Question
How to create a valid object AxHost.Stateto initialize a Unity3D-ActiveX control that should load the Unity3D file I specified?
source
share