PBX_CreateNonVisualObject
Description
Creates a new instance of a nonvisual PowerBuilder extension
object.
Syntax
|
1 |
PBX_CreateNonVisualObject(IPB_Session* pbsession, pbobject pbobj, LPCTSTR xtraName, IPBX_NonVisualObject **obj) |
|
Argument |
Description |
|---|---|
|
pbsession |
This IPB session |
|
pbobj |
The name of a pbobject corresponding to the |
|
xtraname |
The name of the PowerBuilder native class in |
|
obj |
The PowerBuilder extension object to be |
Return value
PBXRESULT. PBX_OK for success.
Examples
In this example, the extension contains several classes. The
object created depends on the string value of the class name passed
in.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
PBXEXPORT PBXRESULT PBXCALL PBX_CreateNonVisualObject ( IPB_Session* pbsession, pbobject pbobj, LPCTSTR xtraName, IPBX_NonVisualObject **obj ) { PBXRESULT result = PBX_OK; string cn(className); if (cn.compare("class_a") == 0) { *obj = new class_a(pbobj); } else if (cn.compare("class_b") == 0) { *obj = new class_b(pbobj); } else if (cn.compare("class_c") == 0) { *obj = new class_b(pbobj); else{ *obj = NULL; result = PBX_E_NO_SUCH_CLASS; } return PBX_OK; }; |
Usage
You must implement this method in every PowerBuilder extension
module that contains nonvisual classes. When you use the CREATE
statement in PowerScript to create a new PowerBuilder extension object,
the PBVM calls this method.
See also