|
The QMCreateObject() function creates an instance of the named class on the server, returning a numeric value that can be used in other QMClient functions that reference this object. This value is returned as zero if instantiation fails.
The function arguments are:
| Class | is the name of the QM class from which the object is to be instantiated. |
| ArgCt | is the number of argument values following. This argument is not present in all variants of the QMClient API. |
| Arg1... | is a series of argument values as strings. A maximum of 20 arguments may be given. |
The argument values are passed into the CREATE.OBJECT public subroutine, if this exists.
When using the C and VB.Net versions of the QMClient API, arguments must be passed as strings. Any argument values updated by the CREATE.OBJECT subroutine can be retrieved using the QMGetArg() function.
For the old Visual Basic version of the QMClient API, the original variables are updated with any modifications from the CREATE.OBJECT subroutine.
The object remains instantiated until either the connection is closed or the QMDestroyObject() function is used.
The QMCLIENT configuration parameter can be used to restrict QMCreateObject() to instantiating only classes that have been compiled with the $QMCALL compiler directive. Use of this feature prevents a malicious application that uses the QMClient API calling other subroutines that might not perform adequate security validation to protect the system.
The example program fragments below instantiate an object based on the CONNECTION class, passing in two argument strings.
int QMCreateObject(char * Class, short int ArgCount, char * Arg1...)
Obj = QMCreateObject("CONNECTION", 2, IpAddr, Port);
Arguments must be passed as strings. Any argument values updated by the CREATE.OBJECT subroutine can be retrieved using the QMGetArg() function.
|
QMCreateObject(ByVal Class as String, ByVal ArgCount as Short, Optional ByVal Arg1 as String, ...) as Integer
Obj = QMCreateObject("CONNECTION", 2, IpAddr, Port)
Arguments must be passed as strings. Any argument values updated by the CREATE.OBJECT subroutine can be retrieved using the QMGetArg() function.
|
CreateObject(Obj, Class, ArgList...)
Objno = obj->CreateObject(Obj, "CONNECTION", IpAddr, Port)
|
int CreateObject(char * Class, int ArgCount, char * Arg1...)
Obj = qm.CreateObject("CONNECTION", 2, IpAddr, Port);
Arguments must be passed as strings. Any argument values updated by the CREATE.OBJECT subroutine can be retrieved using the QMGetArg() function.
|
CreateObject(Class, ArgCount, Arg1...)
Obj = qm.CreateObject("CONNECTION", 2, IpAddr, Port)
Arguments must be passed as strings. Any argument values updated by the CREATE.OBJECT subroutine can be retrieved using the QMGetArg() function.
|
See also:
QMDestroyObject, QMGet(), QMSet
|