PBX_CreateVisualObject
Description
Creates a new instance of a visual PowerBuilder extension
object.
Syntax
|
1 |
PBX_CreateVisualObject(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 |
PBXEXPORT PBXRESULT PBXCALL PBX_CreateVisualObject ( IPB_Session* pbsession, pbobject pbobj, LPCTSTR className, IPBX_VisualObject **obj ) { PBXRESULT result = PBX_OK; string cn(className); if (cn.compare("visualext") == 0) { *obj = new CVisualExt(pbsession, pbobj); } else { *obj = NULL; result = PBX_FAIL; } return PBX_OK; }; |
Usage
You must implement this method in every PowerBuilder extension
module that contains visual classes. When you use a visual extension in
a PowerBuilder application, the PBVM calls this method.
See also