Last active
July 12, 2018 21:10
-
-
Save mattcox/fa299be4164ec8ebbf66 to your computer and use it in GitHub Desktop.
Demonstrates how to get a PackageInstance from a ILxItem COM interface. If you pass this function an item, it will return the class that it derives from, as long as it is one of your classes. Obviously, change the class name to whatever your class is called, as well as the server name!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Instance * | |
getInstance ( | |
ILxUnknownID item) | |
{ | |
CLxLoc_PackageInstance pkgInstance (item); | |
CLxSpawner <Instance> spawn ("myInstance"); | |
if (pkgInstance.test ()) | |
return spawn.Cast (pkgInstance); | |
return NULL; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment