XPLMCreateInstance

XPLM_API XPLMInstanceRef XPLMCreateInstance(
                         XPLMObjectRef        obj,    
                         const char **        datarefs);    

XPLMCreateInstance creates a new instance, managed by your plug-in, and returns a handle to the instance. A few important requirements:

  • The object passed in must be fully loaded and returned from the XPLM before you can create your instance; you cannot pass a null obj ref, nor can you change the ref later.

  • If you use any custom datarefs in your object, they must be registered before the object is loaded. This is true even if their data will be provided via the instance dataref list.

  • The instance dataref array must be a valid ptr to an array of at least one item that is null terminated. That is, if you do not want any datarefs, you must passa ptr to an array with a null item. You cannot pass null for this.