somFindClass - Example Code

#include <som.h>

/*
 *  This program creates a class object
 *  (from a DLL) without requiring the
 *  usage binding file (.h or .xh) for
 *  the class.
 */

void main ()
{
    SOMClass myClass;
    somId animalId;

    somEnvironmentNew ();
    animalId = somIdFromString ("Animal");

/*  The next statement is equivalent to:
 *    #include "animal.h"
 *    myClass = AnimalNewClass (0, 0);
 */
    myClass = SOMClassMgr_somFindClass (SOMClassMgrObject,
                                                 animalId, 0, 0);
    if (myClass)
        somPrintf ("myClass: %s\n", SOMClass_somGetName (myClass));
    else
        somPrintf ("Class %s could not be dynamically loaded\n",
                                       somStringFromId (animalId));
    SOMFree (animalId);
}


[Back: somFindClass - Related Methods]
[Next: somFindClass - Topics]