PBX_Notify

PowerBuilder Native Interface

Exported methods:

PBX_Notify method

Description

Used to initialize and uninitialize a session.

Syntax

PBXEXPORT PBXRESULT PBXCALL PBX_Notify(IPB_Session* pbsession,   pbint reasonForCall)

Return Values

PBXRESULT

Examples

This sample shows code that exports PBX_Notify and displays a message box after the PBX is loaded and before it is unloaded:

PBXEXPORT PBXRESULT PBXCALL PBX_Notify
(
   IPB_Session*   pbsession,
   pbint          reasonForCall
)
{
   switch(reasonForCall)
   {
   case kAfterDllLoaded:
      MessageBox(NULL, "After PBX loading", "",
          MB_OK);
      break;
   case kBeforeDllUnloaded:
      MessageBox(NULL, "Before PBX unloading", "",
          MB_OK);
      break;
   }
   return PBX_OK;
}

Usage

If PBX_NOTIFY is exported, the PBVM calls PBX_Notify immediately after an extension PBX is loaded and just before the PBX is unloaded. You can use this function to initialize and uninitialize a session. For example, you could create a session manager object, and store it in the IPB session using the SetProp function. Later, you could use GetProp to obtain the session object.