IsNativeObject

PowerBuilder Native Interface

IPB_Session interface:

IsNativeObject method

Description

Determines whether a pbobject is an instance of a native class.

Syntax

IsNativeObject(pbobject obj)

Argument

Description

obj

A valid object handle

Return Values

pbboolean.

Examples

The f_getrow function uses IsNativeObject to test whether extObj is a native class. If so, it gets the native interface and invokes the f_getrowcount function in the other class:

long f_getrow(IPB_Session* session, pbobject dwObj,
   pbobject extObj)
{
   long lRet;
   Imy_pbni* pImy_pbni = NULL;
   IPBX_NonVisualObject* pp=NULL;

if (session -> IsNativeObject(extObj) )
   {
      pp = (IPBX_NonVisualObject*) session ->
         GetNativeInterface(extObj);
      pImy_pbni = static_cast<Imy_pbni*>(pp);
      lRet = pImy_pbni-> f_GetRowCount(session, dwObj);
   }
   return lRet;
}

Usage

Use this method in conjunction with GetNativeInterface to obtain a direct reference to the IPBX_UserObject associated with another native class, so that the class and its methods can be accessed directly.

See Also

GetNativeInterface