somLoadClassFile
This method dynamically loads a class.
For backward compatibility, this method does not take an Environment parameter.
- Original Class
- SOMClassMgr
Syntax
SOMClass somLoadClassFile (SOMClassMgr receiver, somID classId, long majorVersion, long minorVersion, string file)
Parameters
- receiver (SOMClassMgr)
- Usually SOMClassMgrObject (or a pointer to an instance of a user-supplied subclass of SOMClassMgr).
- classId (somID)
- The somId representing the name of the class to load.
- majorVersion (long)
- The major version number used to check the compatibility of the class's implementation with the caller's expectations.
- minorVersion (long)
- The minor version number used to check the compatibility of the class's implementation with the caller's expectations.
- file (string)
- The name of the dynamically linked library file containing the class. The name can be either a simple, unqualified name (without any extension) or a fully qualified (or path) file name, as appropriate for your operating system. For example, on OS/2, file could be c:\myhome\myapp\basename.dll or else basename (but not basename.dll).
Return Code
- rc (SOMClass)
- Returns a pointer to the class object, or NULL if the class could not be loaded or the class object could not be created.
Remarks
The SOMClassMgr object uses the somLoadClassFile method to load a class dynamically during the execution of somFindClass or somFindClsInFile. A SOM class object representing the class is expected to be created and registered as a result of this method.
The somLoadClassFile method can be overridden to load or create classes dynamically using your own mechanisms. If you simply wish to change the name of the procedure that is called to initialize the classes in a library, override somGetInitFunction instead.
This method is provided to permit user-created subclasses of SOMClassMgr to handle the loading of classes by overriding this method. Do not invoke this method directly; instead, use somFindClass or somFindClsInFile.