SOM Kernel Reference 1-109
C Example
#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);
}
This program produces the following output:
myClass: Animal
Original Class
SOMClassMgr
Related Information
Methods: somFindClsInFile, somLocateClassFile
Kommentare zu diesen Handbüchern