Game Development Community

Getting an enum from a third-party dll to export to the schema

by Shawn Simas · in Torque X 2D · 10/24/2007 (7:34 pm) · 1 replies

I'm using a third party dll that contains an enum I would like to export for use in TXB.

When it tries to do the -exportschema it throws an error, "Can't find type for element"
How do I go about getting the enum to export?

Would I have to create my own custom enum in the component that uses it, and convert it over to the other at runtime? I do have access to the source to recompile the dll if there is something I could change to the enum to get it to export properly.

Thanks,
Shawn

#1
01/04/2010 (12:19 pm)
I know this is years after the original question, but I ran into a similar problem, but managed to resolve it by adding the following code to my Main() in Game.cs:

#region Public Methods
public static void Main()
{
   // Create the static game instance.  
   _myGame = new Game();

   _myGame.Engine.RegisterAssembly(
      System.Reflection.Assembly.LoadFrom(@"ExtensionLib.dll")); 

   // begin the game.  Further setup is done in BeginRun()
   _myGame.Run();
}
#endregion

Hope it helps.