1-116 SOMobjects Base Toolkit: Programmer’s Reference Manual
somLoadClassFile Method
Purpose
Dynamically loads a class.
IDL Syntax
SOMClass somLoadClassFile (
in somId classId,
in long majorVersion,
in long minorVersion,
in string file);
Note: For backward compatibility, this method does not take an Environment parameter.
Description
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 generally not invoked directly by users. Instead, use somFindClass or
somFindClsInFile.
Parameters
receiver Usually SOMClassMgrObject (or a pointer to an instance of a
user-supplied subclass of SOMClassMgr).
classId The somId representing the name of the class to load.
majorVersion The major version number used to check the compatibility of the class’s
implementation with the caller’s expectations.
minorVersion The minor version number used to check the compatibility of the class’s
implementation with the caller’s expectations.
file 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 Value
The somLoadClassFile method returns a pointer to the class object, or NULL if the class
could not be loaded or the class object could not be created.
Original Class
SOMClassMgr
Related Information
Methods: somFindClass, somFindClsInFile, somGetInitFunction,
somUnloadClassFile
Komentarze do niniejszej Instrukcji