NewObject

PowerBuilder Native Interface

IPB_Session interface:

NewObject method

Description

Creates a new object of the specified type.

Syntax

NewObject(pbclass cls)

Argument

Description

cls

The type of object or structure instance to be created

Return Values

pbobject of the given class or structure.

Examples

pbclass cls;
pbobject ex;
pbgroup group;

group = session-> FindGroup
   ("user_exception", pbgroup_userobject);
if (group==NULL)
   return;
cls = session->FindClass(group, "user_exception");
if (group==NULL)
   return;
ex = session->NewObject(cls);

Usage

The returned object's life cycle is restricted to the current frame unless AddGlobalRef is called on the object.

See Also